Bump version to 24.04.3.4
[LibreOffice.git] / fpicker / source / office / breadcrumb.hxx
blob5f476010c9d1b585c250b0dcced3e57c995ab436
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 */
10 #pragma once
12 #include <vcl/weld.hxx>
13 #include <map>
14 #include <vector>
16 #define SPACING 6
18 enum SvtBreadcrumbMode
20 ONLY_CURRENT_PATH = 0,
21 ALL_VISITED = 1
24 struct BreadcrumbPath
26 BreadcrumbPath(weld::Container* pParent);
27 std::unique_ptr<weld::Builder> m_xBuilder;
28 std::unique_ptr<weld::Container> m_xContainer;
29 std::unique_ptr<weld::LinkButton> m_xLink;
30 std::unique_ptr<weld::Label> m_xSeparator;
33 class Breadcrumb
35 private:
36 weld::Container* m_pParent;
37 int m_nMaxWidth;
39 std::vector<std::unique_ptr<BreadcrumbPath>> m_aSegments;
40 std::map<weld::LinkButton*, OUString> m_aUris;
42 OUString m_sRootName;
43 OUString m_sClickedURL;
44 OUString m_aCurrentURL;
46 SvtBreadcrumbMode m_eMode;
48 Link<Breadcrumb*, bool> m_aClickHdl;
50 void appendField();
51 bool showField(unsigned int nIndex, unsigned int nWidthMax);
53 DECL_LINK(SizeAllocHdl, const Size&, void);
54 DECL_LINK(ClickLinkHdl, weld::LinkButton&, bool);
56 public:
57 Breadcrumb(weld::Container* pParent);
58 ~Breadcrumb();
60 void EnableFields(bool bEnable);
62 void connect_clicked(const Link<Breadcrumb*, bool>& rLink);
63 const OUString& GetHdlURL() const;
65 void SetRootName(const OUString& rURL);
66 void SetURL(const OUString& rURL);
67 void SetMode(SvtBreadcrumbMode eMode);
70 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */