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_PROPCTRLR_SELECTLABELDIALOG_HXX_
25 #define _EXTENSIONS_PROPCTRLR_SELECTLABELDIALOG_HXX_
26 
27 #include <vcl/fixed.hxx>
28 #include <svtools/svtreebx.hxx>
29 #ifndef _SV_BUTTON_HXX
30 #include <vcl/button.hxx>
31 #endif
32 #include <vcl/image.hxx>
33 #include <vcl/dialog.hxx>
34 #include <com/sun/star/beans/XPropertySet.hpp>
35 #ifndef _EXTENSIONS_PROPCTRLR_MODULEPRC_HXX_
36 #include "modulepcr.hxx"
37 #endif
38 
39 //............................................................................
40 namespace pcr
41 {
42 //............................................................................
43 
44 	//========================================================================
45 	// OSelectLabelDialog
46 	//========================================================================
47 	class OSelectLabelDialog
48 			:public ModalDialog
49 			,public PcrClient
50 	{
51 		FixedText		m_aMainDesc;
52 		SvTreeListBox	m_aControlTree;
53 		CheckBox		m_aNoAssignment;
54 		FixedLine		m_aSeparator;
55 		OKButton		m_aOk;
56 		CancelButton	m_aCancel;
57 
58 		ImageList		m_aModelImages;
59 		::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > 	m_xControlModel;
60 		::rtl::OUString	m_sRequiredService;
61 		Image			m_aRequiredControlImage;
62 		SvLBoxEntry*	m_pInitialSelection;
63 		::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > 	m_xInitialLabelControl;
64 
65 		::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > 	m_xSelectedControl;
66 		SvLBoxEntry*	m_pLastSelected;
67 		sal_Bool		m_bHaveAssignableControl;
68 
69 	public:
70 		OSelectLabelDialog(Window* pParent, ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >  _xControlModel);
71 		~OSelectLabelDialog();
72 
GetSelected() const73 		::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >  GetSelected() const { return m_aNoAssignment.IsChecked() ? ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > () : m_xSelectedControl; }
74 
75 	protected:
76 		sal_Int32 InsertEntries(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _xContainer, SvLBoxEntry* pContainerEntry);
77 
78 		DECL_LINK(OnEntrySelected, SvTreeListBox*);
79 		DECL_LINK(OnNoAssignmentClicked, Button*);
80 	};
81 
82 //............................................................................
83 }	// namespace pcr
84 //............................................................................
85 
86 #endif // _EXTENSIONS_PROPCTRLR_SELECTLABELDIALOG_HXX_
87 
88