2015-06-10 15:55:01 +02:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
|
|
|
/*
|
|
|
|
* This file is part of the LibreOffice project.
|
|
|
|
*
|
|
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef INCLUDED_SVTOOLS_BREADCRUMB_HXX
|
|
|
|
#define INCLUDED_SVTOOLS_BREADCRUMB_HXX
|
|
|
|
|
|
|
|
#include <svtools/svtdllapi.h>
|
|
|
|
|
|
|
|
#include <tools/urlobj.hxx>
|
|
|
|
|
|
|
|
#include <vcl/fixedhyper.hxx>
|
|
|
|
#include <vcl/layout.hxx>
|
|
|
|
|
|
|
|
#include <vector>
|
|
|
|
|
2015-06-12 17:33:28 +02:00
|
|
|
#define SPACING 6
|
|
|
|
|
2015-06-10 17:24:12 +02:00
|
|
|
enum SvtBreadcrumbMode
|
|
|
|
{
|
|
|
|
ONLY_CURRENT_PATH = 0,
|
|
|
|
ALL_VISITED = 1
|
|
|
|
};
|
|
|
|
|
2015-08-21 10:29:49 +02:00
|
|
|
class CustomLink;
|
|
|
|
|
2015-06-10 15:55:01 +02:00
|
|
|
class SVT_DLLPUBLIC Breadcrumb : public VclHBox
|
|
|
|
{
|
|
|
|
private:
|
2015-08-21 10:29:49 +02:00
|
|
|
std::vector< VclPtr< CustomLink > > m_aLinks;
|
2015-06-10 15:55:01 +02:00
|
|
|
std::vector< VclPtr< FixedText > > m_aSeparators;
|
|
|
|
|
|
|
|
OUString m_sRootName;
|
|
|
|
OUString m_sClickedURL;
|
2015-07-23 16:22:33 +02:00
|
|
|
OUString m_aCurrentURL;
|
2015-06-10 15:55:01 +02:00
|
|
|
|
2015-06-10 17:24:12 +02:00
|
|
|
SvtBreadcrumbMode m_eMode;
|
|
|
|
|
2015-08-14 16:12:48 +02:00
|
|
|
Link<Breadcrumb*,void> m_aClickHdl;
|
2015-06-10 15:55:01 +02:00
|
|
|
|
|
|
|
void appendField();
|
2015-06-12 17:33:28 +02:00
|
|
|
bool showField( unsigned int nIndex, unsigned int nWidthMax );
|
2015-06-10 15:55:01 +02:00
|
|
|
|
2016-10-05 07:56:12 +02:00
|
|
|
DECL_LINK( ClickLinkHdl, FixedHyperlink&, void );
|
2015-06-10 15:55:01 +02:00
|
|
|
|
|
|
|
public:
|
2016-04-01 15:43:18 +02:00
|
|
|
Breadcrumb( vcl::Window* pParent );
|
2016-09-13 13:09:01 +02:00
|
|
|
virtual ~Breadcrumb() override;
|
2015-06-10 15:55:01 +02:00
|
|
|
|
2015-10-12 16:04:04 +02:00
|
|
|
void dispose() override;
|
2015-07-23 16:22:33 +02:00
|
|
|
void EnableFields( bool bEnable );
|
2015-06-10 15:55:01 +02:00
|
|
|
|
2015-08-14 16:12:48 +02:00
|
|
|
void SetClickHdl( const Link<Breadcrumb*,void>& rLink );
|
2016-04-13 11:30:11 +02:00
|
|
|
const OUString& GetHdlURL();
|
2015-06-10 15:55:01 +02:00
|
|
|
|
|
|
|
void SetRootName( const OUString& rURL );
|
|
|
|
void SetURL( const OUString& rURL );
|
2015-06-10 17:24:12 +02:00
|
|
|
void SetMode( SvtBreadcrumbMode eMode );
|
2015-06-10 15:55:01 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|