build fix
[LibreOffice.git] / fpicker / source / office / PlacesListBox.hxx
blobddc92d85243f013519a798658bdb1f47b32df613
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 #ifndef INCLUDED_FPICKER_SOURCE_OFFICE_PLACESLISTBOX_HXX
10 #define INCLUDED_FPICKER_SOURCE_OFFICE_PLACESLISTBOX_HXX
12 #include <iodlg.hxx>
14 #include <svtools/place.hxx>
15 #include <svtools/svtabbx.hxx>
17 #include <memory>
18 #include <vector>
20 typedef std::shared_ptr< Place > PlacePtr;
22 class PlacesListBox;
23 class PlacesListBox_Impl : public SvHeaderTabListBox
25 private:
26 VclPtr<HeaderBar> mpHeaderBar;
27 VclPtr<PlacesListBox> mpParent;
29 public:
30 PlacesListBox_Impl( PlacesListBox* pParent, const OUString& rTitle );
31 virtual ~PlacesListBox_Impl( ) override;
32 virtual void dispose() override;
34 virtual void MouseButtonUp( const MouseEvent& rMEvt ) override;
37 /** ListBox to handle Places.
39 class PlacesListBox : public Control
41 private:
42 std::vector< PlacePtr > maPlaces;
43 VclPtr<SvtFileDialog> mpDlg;
44 VclPtr<PlacesListBox_Impl> mpImpl;
45 VclPtr<PushButton> mpAddBtn;
46 VclPtr<PushButton> mpDelBtn;
47 sal_Int32 mnNbEditables;
48 bool mbUpdated;
49 bool mbSelectionChanged;
51 public:
52 PlacesListBox( vcl::Window* pParent, SvtFileDialog* pFileDlg, const OUString& rTitle, WinBits nBits );
53 virtual ~PlacesListBox( ) override;
54 virtual void dispose() override;
56 void AppendPlace( const PlacePtr& pPlace );
57 void RemovePlace( sal_uInt16 nPos );
58 void RemoveSelectedPlace();
59 sal_Int32 GetNbEditablePlaces() { return mnNbEditables;}
60 bool IsUpdated();
61 const std::vector<PlacePtr>& GetPlaces() { return maPlaces;}
63 void SetAddHdl( const Link<Button*,void>& rHdl );
64 void SetDelHdl( const Link<Button*,void>& rHdl );
65 void SetDelEnabled( bool enabled );
66 void SetSizePixel( const Size& rNewSize ) override;
67 void updateView( );
69 const VclPtr<PushButton>& GetAddButton() const { return mpAddBtn; }
70 const VclPtr<PushButton>& GetDeleteButton() const { return mpDelBtn; }
71 const VclPtr<PlacesListBox_Impl>& GetPlacesListBox() const { return mpImpl; }
73 virtual bool EventNotify( NotifyEvent& rNEvt ) override;
75 private:
77 Image getEntryIcon( const PlacePtr& pPlace );
79 DECL_LINK( Selection, SvTreeListBox*, void );
80 DECL_LINK( DoubleClick, SvTreeListBox*, bool );
83 #endif
85 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */