Update git submodules
[LibreOffice.git] / fpicker / source / office / PlacesListBox.hxx
blob934126072d53dcf2b5f3032d389a2750ddfb519e
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 */
9 #pragma once
11 #include "iodlg.hxx"
13 #include <svtools/place.hxx>
14 #include <vcl/weld.hxx>
16 #include <memory>
17 #include <vector>
19 typedef std::shared_ptr<Place> PlacePtr;
21 class PlacesListBox;
23 /** ListBox to handle Places.
25 class PlacesListBox
27 private:
28 std::vector<PlacePtr> maPlaces;
29 SvtFileDialog* mpDlg;
30 std::unique_ptr<weld::TreeView> mxImpl;
31 std::unique_ptr<weld::Button> mxAddBtn;
32 std::unique_ptr<weld::Button> mxDelBtn;
33 sal_Int32 mnNbEditables;
34 bool mbUpdated;
36 public:
37 PlacesListBox(std::unique_ptr<weld::TreeView> xTreeView,
38 std::unique_ptr<weld::Button> xAddBtn,
39 std::unique_ptr<weld::Button> xDelBtn,
40 SvtFileDialog* pFileDlg);
41 ~PlacesListBox();
43 void AppendPlace( const PlacePtr& pPlace );
44 void RemovePlace( sal_uInt16 nPos );
45 void RemoveSelectedPlace();
46 sal_Int32 GetNbEditablePlaces() const { return mnNbEditables;}
47 bool IsUpdated();
48 const std::vector<PlacePtr>& GetPlaces() const { return maPlaces;}
50 void SetAddHdl( const Link<weld::Button&,void>& rHdl );
51 void SetDelHdl( const Link<weld::Button&,void>& rHdl );
52 void SetDelEnabled( bool enabled );
53 void updateView( );
55 void set_help_id(const OUString& rHelpId) { mxImpl->set_help_id(rHelpId); }
57 private:
59 static OUString getEntryIcon(const PlacePtr& pPlace);
61 DECL_LINK( Selection, weld::TreeView&, void );
62 DECL_LINK( DoubleClick, weld::TreeView&, bool );
63 DECL_LINK(QueryTooltipHdl, const weld::TreeIter&, OUString);
66 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */