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( );
32 virtual void dispose() SAL_OVERRIDE
;
34 virtual void MouseButtonUp( const MouseEvent
& rMEvt
) SAL_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( );
54 virtual void dispose() SAL_OVERRIDE
;
56 void AppendPlace( 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
<>& rHdl
);
64 void SetDelHdl( const Link
<>& rHdl
);
65 void SetDelEnabled( bool enabled
);
66 void SetSizePixel( const Size
& rNewSize
) SAL_OVERRIDE
;
69 VclPtr
<PushButton
> GetAddButton() const { return mpAddBtn
; }
70 VclPtr
<PushButton
> GetDeleteButton() const { return mpDelBtn
; }
71 VclPtr
<PlacesListBox_Impl
> GetPlacesListBox() const { return mpImpl
; }
73 virtual bool Notify( NotifyEvent
& rNEvt
) SAL_OVERRIDE
;
77 Image
getEntryIcon( PlacePtr pPlace
);
79 DECL_LINK( Selection
, void* );
80 DECL_LINK( DoubleClick
, void* );
85 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */