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/.
13 #include <svtools/place.hxx>
14 #include <vcl/weld.hxx>
19 typedef std::shared_ptr
<Place
> PlacePtr
;
23 /** ListBox to handle Places.
28 std::vector
<PlacePtr
> maPlaces
;
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
;
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
);
43 void AppendPlace( const PlacePtr
& pPlace
);
44 void RemovePlace( sal_uInt16 nPos
);
45 void RemoveSelectedPlace();
46 sal_Int32
GetNbEditablePlaces() const { return mnNbEditables
;}
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
);
55 void set_help_id(const OUString
& rHelpId
) { mxImpl
->set_help_id(rHelpId
); }
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: */