1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 
28 #ifndef EXTENSIONS_SOURCE_PROPCTRLR_LISTSELECTIONDLG_HXX
29 #define EXTENSIONS_SOURCE_PROPCTRLR_LISTSELECTIONDLG_HXX
30 
31 #include <vcl/dialog.hxx>
32 #include <vcl/fixed.hxx>
33 #ifndef _SV_BUTTON_HXX
34 #include <vcl/button.hxx>
35 #endif
36 #include <vcl/lstbox.hxx>
37 
38 /** === begin UNO includes === **/
39 #include <com/sun/star/beans/XPropertySet.hpp>
40 /** === end UNO includes === **/
41 
42 //........................................................................
43 namespace pcr
44 {
45 //........................................................................
46 
47 	//====================================================================
48 	//= ListSelectionDialog
49 	//====================================================================
50     class ListSelectionDialog : public ModalDialog
51 	{
52     private:
53         FixedText       m_aLabel;
54         ListBox         m_aEntries;
55         OKButton        m_aOK;
56         CancelButton    m_aCancel;
57         HelpButton      m_aHelp;
58 
59         ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >
60                         m_xListBox;
61         ::rtl::OUString m_sPropertyName;
62 
63     public:
64         ListSelectionDialog(
65             Window* _pParent,
66             const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _rxListBox,
67             const ::rtl::OUString& _rPropertyName,
68             const String& _rPropertyUIName
69         );
70 
71         // Dialog overridables
72         virtual short   Execute();
73 
74     private:
75         void    initialize( );
76         void    commitSelection();
77 
78         void    fillEntryList   ( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& _rListEntries );
79 
80         void    selectEntries   ( const ::com::sun::star::uno::Sequence< sal_Int16 >& /* [in ] */ _rSelection );
81         void    collectSelection(       ::com::sun::star::uno::Sequence< sal_Int16 >& /* [out] */ _rSelection );
82 	};
83 
84 //........................................................................
85 } // namespacepcr
86 //........................................................................
87 
88 #endif // EXTENSIONS_SOURCE_PROPCTRLR_LISTSELECTIONDLG_HXX
89 
90