1 /************************************************************** 2 * 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance 9 * with the License. You may obtain a copy of the License at 10 * 11 * http://www.apache.org/licenses/LICENSE-2.0 12 * 13 * Unless required by applicable law or agreed to in writing, 14 * software distributed under the License is distributed on an 15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 * KIND, either express or implied. See the License for the 17 * specific language governing permissions and limitations 18 * under the License. 19 * 20 *************************************************************/ 21 22 23 24 #ifndef EXTENSIONS_SOURCE_PROPCTRLR_LISTSELECTIONDLG_HXX 25 #define EXTENSIONS_SOURCE_PROPCTRLR_LISTSELECTIONDLG_HXX 26 27 #include <vcl/dialog.hxx> 28 #include <vcl/fixed.hxx> 29 #ifndef _SV_BUTTON_HXX 30 #include <vcl/button.hxx> 31 #endif 32 #include <vcl/lstbox.hxx> 33 34 /** === begin UNO includes === **/ 35 #include <com/sun/star/beans/XPropertySet.hpp> 36 /** === end UNO includes === **/ 37 38 //........................................................................ 39 namespace pcr 40 { 41 //........................................................................ 42 43 //==================================================================== 44 //= ListSelectionDialog 45 //==================================================================== 46 class ListSelectionDialog : public ModalDialog 47 { 48 private: 49 FixedText m_aLabel; 50 ListBox m_aEntries; 51 OKButton m_aOK; 52 CancelButton m_aCancel; 53 HelpButton m_aHelp; 54 55 ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > 56 m_xListBox; 57 ::rtl::OUString m_sPropertyName; 58 59 public: 60 ListSelectionDialog( 61 Window* _pParent, 62 const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _rxListBox, 63 const ::rtl::OUString& _rPropertyName, 64 const String& _rPropertyUIName 65 ); 66 67 // Dialog overridables 68 virtual short Execute(); 69 70 private: 71 void initialize( ); 72 void commitSelection(); 73 74 void fillEntryList ( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& _rListEntries ); 75 76 void selectEntries ( const ::com::sun::star::uno::Sequence< sal_Int16 >& /* [in ] */ _rSelection ); 77 void collectSelection( ::com::sun::star::uno::Sequence< sal_Int16 >& /* [out] */ _rSelection ); 78 }; 79 80 //........................................................................ 81 } // namespacepcr 82 //........................................................................ 83 84 #endif // EXTENSIONS_SOURCE_PROPCTRLR_LISTSELECTIONDLG_HXX 85 86