2012-01-30 17:44:34 -06:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
|
|
|
/*
|
|
|
|
* Version: MPL 1.1 / GPLv3+ / LGPLv3+
|
|
|
|
*
|
|
|
|
* The contents of this file are subject to the Mozilla Public License Version
|
|
|
|
* 1.1 (the "License"); you may not use this file except in compliance with
|
|
|
|
* the License or as specified alternatively below. You may obtain a copy of
|
|
|
|
* the License at http://www.mozilla.org/MPL/
|
|
|
|
*
|
|
|
|
* Software distributed under the License is distributed on an "AS IS" basis,
|
|
|
|
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
|
|
|
* for the specific language governing rights and limitations under the
|
|
|
|
* License.
|
|
|
|
*
|
|
|
|
* Major Contributor(s):
|
|
|
|
* [ Copyright (C) 2011 Cedric Bosdonnat <cbosdonnat@suse.com> (initial developer) ]
|
|
|
|
*
|
|
|
|
* All Rights Reserved.
|
|
|
|
*
|
|
|
|
* For minor contributions see the git repository.
|
|
|
|
*
|
|
|
|
* Alternatively, the contents of this file may be used under the terms of
|
|
|
|
* either the GNU General Public License Version 3 or later (the "GPLv3+"), or
|
|
|
|
* the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
|
|
|
|
* in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
|
|
|
|
* instead of those above.
|
|
|
|
*/
|
|
|
|
#ifndef _PLACESLISTBOX_HXX_
|
|
|
|
#define _PLACESLISTBOX_HXX_
|
|
|
|
|
|
|
|
#include <iodlg.hxx>
|
2012-03-27 11:01:07 -05:00
|
|
|
|
2012-01-30 17:44:34 -06:00
|
|
|
#include <boost/shared_ptr.hpp>
|
2012-08-03 17:42:51 -05:00
|
|
|
#include <svtools/place.hxx>
|
2012-03-27 11:01:07 -05:00
|
|
|
#include <svtools/svtabbx.hxx>
|
|
|
|
|
2012-01-30 17:44:34 -06:00
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
typedef boost::shared_ptr< Place > PlacePtr;
|
|
|
|
|
2012-06-27 10:04:34 -05:00
|
|
|
class PlacesListBox;
|
2012-03-27 11:01:07 -05:00
|
|
|
class PlacesListBox_Impl : public SvHeaderTabListBox
|
|
|
|
{
|
|
|
|
private:
|
|
|
|
HeaderBar* mpHeaderBar;
|
2012-06-27 10:04:34 -05:00
|
|
|
PlacesListBox* mpParent;
|
2012-03-27 11:01:07 -05:00
|
|
|
|
|
|
|
public:
|
2012-12-08 05:42:54 -06:00
|
|
|
PlacesListBox_Impl( PlacesListBox* pParent, const OUString& rTitle );
|
2012-03-27 11:01:07 -05:00
|
|
|
~PlacesListBox_Impl( );
|
2012-06-27 10:04:34 -05:00
|
|
|
|
|
|
|
virtual void MouseButtonUp( const MouseEvent& rMEvt );
|
2012-03-27 11:01:07 -05:00
|
|
|
};
|
|
|
|
|
2012-01-30 17:44:34 -06:00
|
|
|
/** ListBox to handle Places.
|
|
|
|
*/
|
2012-03-27 11:01:07 -05:00
|
|
|
class PlacesListBox : public Control
|
2012-01-30 17:44:34 -06:00
|
|
|
{
|
|
|
|
private:
|
|
|
|
std::vector< PlacePtr > maPlaces;
|
|
|
|
SvtFileDialog* mpDlg;
|
2012-03-27 11:01:07 -05:00
|
|
|
PlacesListBox_Impl* mpImpl;
|
2012-07-13 10:16:40 -05:00
|
|
|
PushButton* mpAddBtn;
|
|
|
|
PushButton* mpDelBtn;
|
2012-01-30 17:44:34 -06:00
|
|
|
sal_Int32 mnNbEditables;
|
|
|
|
bool mbUpdated;
|
2012-06-27 10:04:34 -05:00
|
|
|
bool mbSelectionChanged;
|
2012-01-30 17:44:34 -06:00
|
|
|
|
|
|
|
public:
|
2012-12-08 05:42:54 -06:00
|
|
|
PlacesListBox( SvtFileDialog* pFileDlg, const OUString& rTitle, const ResId& rResId );
|
2012-01-30 17:44:34 -06:00
|
|
|
~PlacesListBox( );
|
|
|
|
|
|
|
|
void AppendPlace( PlacePtr pPlace );
|
|
|
|
void RemovePlace( sal_uInt16 nPos );
|
|
|
|
void RemoveSelectedPlace();
|
|
|
|
sal_Int32 GetNbEditablePlaces();
|
|
|
|
bool IsUpdated();
|
|
|
|
const std::vector<PlacePtr>& GetPlaces();
|
|
|
|
|
2012-07-13 10:16:40 -05:00
|
|
|
void SetAddHdl( const Link& rHdl );
|
|
|
|
void SetDelHdl( const Link& rHdl );
|
|
|
|
void SetDelEnabled( bool enabled );
|
2012-03-27 11:01:07 -05:00
|
|
|
void SetSizePixel( const Size& rNewSize );
|
2012-06-27 10:04:34 -05:00
|
|
|
void updateView( );
|
2012-03-27 11:01:07 -05:00
|
|
|
|
2012-01-30 17:44:34 -06:00
|
|
|
private:
|
|
|
|
|
2012-03-27 11:01:07 -05:00
|
|
|
Image getEntryIcon( PlacePtr pPlace );
|
2012-01-30 17:44:34 -06:00
|
|
|
|
2012-03-27 11:01:07 -05:00
|
|
|
DECL_LINK( Selection, void* );
|
|
|
|
DECL_LINK( DoubleClick, void* );
|
2012-01-30 17:44:34 -06:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|