/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* * This file is part of the LibreOffice project. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef INCLUDED_FPICKER_SOURCE_OFFICE_PLACESLISTBOX_HXX #define INCLUDED_FPICKER_SOURCE_OFFICE_PLACESLISTBOX_HXX #include "iodlg.hxx" #include #include #include #include typedef std::shared_ptr< Place > PlacePtr; class PlacesListBox; class PlacesListBox_Impl : public SvHeaderTabListBox { private: VclPtr mpHeaderBar; VclPtr mpParent; public: PlacesListBox_Impl( PlacesListBox* pParent, const OUString& rTitle ); virtual ~PlacesListBox_Impl( ) override; virtual void dispose() override; virtual void MouseButtonUp( const MouseEvent& rMEvt ) override; }; /** ListBox to handle Places. */ class PlacesListBox : public Control { private: std::vector< PlacePtr > maPlaces; VclPtr mpDlg; VclPtr mpImpl; VclPtr mpAddBtn; VclPtr mpDelBtn; sal_Int32 mnNbEditables; bool mbUpdated; bool mbSelectionChanged; public: PlacesListBox( vcl::Window* pParent, SvtFileDialog* pFileDlg, const OUString& rTitle, WinBits nBits ); virtual ~PlacesListBox( ) override; virtual void dispose() override; void AppendPlace( const PlacePtr& pPlace ); void RemovePlace( sal_uInt16 nPos ); void RemoveSelectedPlace(); sal_Int32 GetNbEditablePlaces() { return mnNbEditables;} bool IsUpdated(); const std::vector& GetPlaces() { return maPlaces;} void SetAddHdl( const Link& rHdl ); void SetDelHdl( const Link& rHdl ); void SetDelEnabled( bool enabled ); void SetSizePixel( const Size& rNewSize ) override; void updateView( ); const VclPtr& GetAddButton() const { return mpAddBtn; } const VclPtr& GetDeleteButton() const { return mpDelBtn; } const VclPtr& GetPlacesListBox() const { return mpImpl; } virtual bool EventNotify( NotifyEvent& rNEvt ) override; private: static Image getEntryIcon( const PlacePtr& pPlace ); DECL_LINK( Selection, SvTreeListBox*, void ); DECL_LINK( DoubleClick, SvTreeListBox*, bool ); }; #endif /* vim:set shiftwidth=4 softtabstop=4 expandtab: */