1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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/.
9 #ifndef INCLUDED_FPICKER_SOURCE_OFFICE_PLACESLISTBOX_HXX
10 #define INCLUDED_FPICKER_SOURCE_OFFICE_PLACESLISTBOX_HXX
14 #include <svtools/place.hxx>
15 #include <svtools/svtabbx.hxx>
20 typedef std::shared_ptr
< Place
> PlacePtr
;
23 class PlacesListBox_Impl
: public SvHeaderTabListBox
26 VclPtr
<HeaderBar
> mpHeaderBar
;
27 VclPtr
<PlacesListBox
> mpParent
;
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
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
;
49 bool mbSelectionChanged
;
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
;}
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
;
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
;
77 Image
getEntryIcon( const PlacePtr
& pPlace
);
79 DECL_LINK( Selection
, SvTreeListBox
*, void );
80 DECL_LINK( DoubleClick
, SvTreeListBox
*, bool );
85 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */