LibreOffice Module fpicker (master) 1
PlacesListBox.hxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
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
10
11#include "iodlg.hxx"
12
13#include <svtools/place.hxx>
14#include <vcl/weld.hxx>
15
16#include <memory>
17#include <vector>
18
19typedef std::shared_ptr<Place> PlacePtr;
20
21class PlacesListBox;
22
26{
27private:
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;
35
36public:
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);
42
43 void AppendPlace( const PlacePtr& pPlace );
44 void RemovePlace( sal_uInt16 nPos );
46 sal_Int32 GetNbEditablePlaces() const { return mnNbEditables;}
47 bool IsUpdated();
48 const std::vector<PlacePtr>& GetPlaces() const { return maPlaces;}
49
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( );
54
55 void set_help_id(const OUString& rHelpId) { mxImpl->set_help_id(rHelpId); }
56
57private:
58
59 static OUString getEntryIcon(const PlacePtr& pPlace);
60
62 DECL_LINK( DoubleClick, weld::TreeView&, bool );
63 DECL_LINK(QueryTooltipHdl, const weld::TreeIter&, OUString);
64};
65
66/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
std::shared_ptr< Place > PlacePtr
ListBox to handle Places.
std::unique_ptr< weld::Button > mxAddBtn
DECL_LINK(DoubleClick, weld::TreeView &, bool)
void AppendPlace(const PlacePtr &pPlace)
SvtFileDialog * mpDlg
void RemoveSelectedPlace()
std::unique_ptr< weld::Button > mxDelBtn
DECL_LINK(QueryTooltipHdl, const weld::TreeIter &, OUString)
void RemovePlace(sal_uInt16 nPos)
sal_Int32 GetNbEditablePlaces() const
void SetAddHdl(const Link< weld::Button &, void > &rHdl)
PlacesListBox(std::unique_ptr< weld::TreeView > xTreeView, std::unique_ptr< weld::Button > xAddBtn, std::unique_ptr< weld::Button > xDelBtn, SvtFileDialog *pFileDlg)
void SetDelHdl(const Link< weld::Button &, void > &rHdl)
std::unique_ptr< weld::TreeView > mxImpl
DECL_LINK(Selection, weld::TreeView &, void)
std::vector< PlacePtr > maPlaces
void SetDelEnabled(bool enabled)
static OUString getEntryIcon(const PlacePtr &pPlace)
const std::vector< PlacePtr > & GetPlaces() const
sal_Int32 mnNbEditables
void set_help_id(const OUString &rHelpId)