Branch data Line data Source code
1 : : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : : /*************************************************************************
3 : : *
4 : : * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 : : *
6 : : * Copyright 2000, 2010 Oracle and/or its affiliates.
7 : : *
8 : : * OpenOffice.org - a multi-platform office productivity suite
9 : : *
10 : : * This file is part of OpenOffice.org.
11 : : *
12 : : * OpenOffice.org is free software: you can redistribute it and/or modify
13 : : * it under the terms of the GNU Lesser General Public License version 3
14 : : * only, as published by the Free Software Foundation.
15 : : *
16 : : * OpenOffice.org is distributed in the hope that it will be useful,
17 : : * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 : : * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 : : * GNU Lesser General Public License version 3 for more details
20 : : * (a copy is included in the LICENSE file that accompanied this code).
21 : : *
22 : : * You should have received a copy of the GNU Lesser General Public License
23 : : * version 3 along with OpenOffice.org. If not, see
24 : : * <http://www.openoffice.org/license.html>
25 : : * for a copy of the LGPLv3 License.
26 : : *
27 : : ************************************************************************/
28 : :
29 : : #ifndef TOOLKIT_DIALOG_CONTROL_HXX
30 : : #define TOOLKIT_DIALOG_CONTROL_HXX
31 : :
32 : : #include <toolkit/controls/controlmodelcontainerbase.hxx>
33 : : #include <com/sun/star/awt/XTopWindow.hpp>
34 : : #include <com/sun/star/awt/XDialog2.hpp>
35 : : #include <com/sun/star/awt/XSimpleTabController.hpp>
36 : : #include <com/sun/star/resource/XStringResourceResolver.hpp>
37 : : #include <com/sun/star/graphic/XGraphicObject.hpp>
38 : : #include "toolkit/helper/servicenames.hxx"
39 : : #include "toolkit/helper/macros.hxx"
40 : : #include <toolkit/controls/unocontrolcontainer.hxx>
41 : : #include <cppuhelper/basemutex.hxx>
42 : : #include <cppuhelper/implbase3.hxx>
43 : : #include <list>
44 : :
45 : : // ----------------------------------------------------
46 : : // class UnoControlDialogModel
47 : : // ----------------------------------------------------
48 : :
49 : : class UnoControlDialogModel : public ControlModelContainerBase
50 : : {
51 : : protected:
52 : : ::com::sun::star::uno::Reference< ::com::sun::star::graphic::XGraphicObject > mxGrfObj;
53 : : ::com::sun::star::uno::Any ImplGetDefaultValue( sal_uInt16 nPropId ) const;
54 : : ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper();
55 : : // ::cppu::OPropertySetHelper
56 : : void SAL_CALL setFastPropertyValue_NoBroadcast( sal_Int32 nHandle, const ::com::sun::star::uno::Any& rValue ) throw (::com::sun::star::uno::Exception);
57 : : public:
58 : : UnoControlDialogModel( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory );
59 : : UnoControlDialogModel( const UnoControlDialogModel& rModel );
60 : : ~UnoControlDialogModel();
61 : :
62 : : UnoControlModel* Clone() const;
63 : : // ::com::sun::star::beans::XMultiPropertySet
64 : : ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException);
65 : :
66 : : // ::com::sun::star::io::XPersistObject
67 : : ::rtl::OUString SAL_CALL getServiceName() throw(::com::sun::star::uno::RuntimeException);
68 : :
69 : : // XServiceInfo
70 [ + - ][ + - ]: 16 : DECLIMPL_SERVICEINFO_DERIVED( UnoControlDialogModel, ControlModelContainerBase, szServiceName2_UnoControlDialogModel )
71 : :
72 : : };
73 : :
74 : : typedef ::cppu::AggImplInheritanceHelper3 < ControlContainerBase
75 : : , ::com::sun::star::awt::XTopWindow
76 : : , ::com::sun::star::awt::XDialog2
77 : : , ::com::sun::star::awt::XWindowListener
78 : : > UnoDialogControl_Base;
79 : : class UnoDialogControl : public UnoDialogControl_Base
80 : : {
81 : : private:
82 : : ::com::sun::star::uno::Reference< ::com::sun::star::awt::XMenuBar > mxMenuBar;
83 : : TopWindowListenerMultiplexer maTopWindowListeners;
84 : : bool mbWindowListener;
85 : :
86 : : public:
87 : :
88 : : UnoDialogControl( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory );
89 : : ~UnoDialogControl();
90 : : ::rtl::OUString GetComponentServiceName();
91 : :
92 : : void SAL_CALL createPeer( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XToolkit >& Toolkit, const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer >& Parent ) throw(::com::sun::star::uno::RuntimeException);
93 : : void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw(::com::sun::star::uno::RuntimeException);
94 : : void SAL_CALL dispose() throw(::com::sun::star::uno::RuntimeException);
95 : :
96 : : // ::com::sun::star::awt::XTopWindow
97 : : void SAL_CALL addTopWindowListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XTopWindowListener >& xListener ) throw (::com::sun::star::uno::RuntimeException);
98 : : void SAL_CALL removeTopWindowListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XTopWindowListener >& xListener ) throw (::com::sun::star::uno::RuntimeException);
99 : : void SAL_CALL toFront( ) throw (::com::sun::star::uno::RuntimeException);
100 : : void SAL_CALL toBack( ) throw (::com::sun::star::uno::RuntimeException);
101 : : void SAL_CALL setMenuBar( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XMenuBar >& xMenu ) throw (::com::sun::star::uno::RuntimeException);
102 : :
103 : : // ::com::sun::star::awt::XWindowListener
104 : : virtual void SAL_CALL windowResized( const ::com::sun::star::awt::WindowEvent& e ) throw (::com::sun::star::uno::RuntimeException);
105 : : virtual void SAL_CALL windowMoved( const ::com::sun::star::awt::WindowEvent& e ) throw (::com::sun::star::uno::RuntimeException);
106 : : virtual void SAL_CALL windowShown( const ::com::sun::star::lang::EventObject& e ) throw (::com::sun::star::uno::RuntimeException);
107 : : virtual void SAL_CALL windowHidden( const ::com::sun::star::lang::EventObject& e ) throw (::com::sun::star::uno::RuntimeException);
108 : :
109 : : // ::com::sun::star::awt::XDialog2
110 : : virtual void SAL_CALL endDialog( ::sal_Int32 Result ) throw (::com::sun::star::uno::RuntimeException);
111 : : virtual void SAL_CALL setHelpId( const rtl::OUString& Id ) throw (::com::sun::star::uno::RuntimeException);
112 : :
113 : : // ::com::sun::star::awt::XDialog
114 : : void SAL_CALL setTitle( const ::rtl::OUString& Title ) throw(::com::sun::star::uno::RuntimeException);
115 : : ::rtl::OUString SAL_CALL getTitle() throw(::com::sun::star::uno::RuntimeException);
116 : : sal_Int16 SAL_CALL execute() throw(::com::sun::star::uno::RuntimeException);
117 : : void SAL_CALL endExecute() throw(::com::sun::star::uno::RuntimeException);
118 : :
119 : : // ::com::sun::star::awt::XControl
120 : : sal_Bool SAL_CALL setModel( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel >& Model ) throw(::com::sun::star::uno::RuntimeException);
121 : :
122 : : // XModifyListener
123 : : virtual void SAL_CALL modified( const ::com::sun::star::lang::EventObject& aEvent ) throw (::com::sun::star::uno::RuntimeException);
124 : :
125 : : // ::com::sun::star::lang::XServiceInfo
126 [ # # ][ # # ]: 0 : DECLIMPL_SERVICEINFO( UnoDialogControl, szServiceName2_UnoControlDialog )
[ # # ][ # # ]
[ # # ]
127 : :
128 : : protected:
129 : : virtual void PrepareWindowDescriptor( ::com::sun::star::awt::WindowDescriptor& rDesc );
130 : : virtual void ImplModelPropertiesChanged( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyChangeEvent >& rEvents ) throw(::com::sun::star::uno::RuntimeException);
131 : : protected:
132 : : };
133 : :
134 : : class UnoMultiPageModel : public ControlModelContainerBase
135 : : {
136 : : public:
137 : : UnoMultiPageModel( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory );
138 : : ~UnoMultiPageModel();
139 : : UnoMultiPageModel( const UnoMultiPageModel& rModel );
140 : :
141 : : UnoControlModel* Clone() const;
142 : :
143 [ # # ][ # # ]: 0 : DECLIMPL_SERVICEINFO_DERIVED( UnoMultiPageModel, ControlModelContainerBase, szServiceName_UnoMultiPageModel )
144 : :
145 : : virtual ::rtl::OUString SAL_CALL getServiceName() throw(::com::sun::star::uno::RuntimeException);
146 : : virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw( ::com::sun::star::uno::RuntimeException);
147 : : // XNamedContainer
148 : : void SAL_CALL insertByName( const ::rtl::OUString& aName, const ::com::sun::star::uno::Any& aElement ) throw(::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::container::ElementExistException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
149 : :
150 : : // Override the method of parent Class
151 : : virtual sal_Bool SAL_CALL getGroupControl( ) throw (::com::sun::star::uno::RuntimeException);
152 : : protected:
153 : : virtual ::com::sun::star::uno::Any ImplGetDefaultValue( sal_uInt16 nPropId ) const;
154 : : ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper();
155 : :
156 : : };
157 : :
158 : : class UnoMultiPageControl : public ControlContainerBase
159 : : ,public ::com::sun::star::awt::XSimpleTabController
160 : : ,public ::com::sun::star::awt::XTabListener
161 : : {
162 : : TabListenerMultiplexer maTabListeners;
163 : : void bindPage( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControl >& _rxControl );
164 : : public:
165 : : UnoMultiPageControl( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory );
166 : : ~UnoMultiPageControl();
167 : : ::rtl::OUString GetComponentServiceName();
168 : :
169 : : // ::com::sun::star::lang::XServiceInfo
170 [ # # ][ # # ]: 0 : DECLIMPL_SERVICEINFO_DERIVED( UnoMultiPageControl, ControlContainerBase, szServiceName_UnoMultiPageControl )
171 : 0 : ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException) { return ControlContainerBase::queryInterface(rType); }
172 : : ::com::sun::star::uno::Any SAL_CALL queryAggregation( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
173 : 0 : void SAL_CALL acquire() throw() { OWeakAggObject::acquire(); }
174 : 0 : void SAL_CALL release() throw() { OWeakAggObject::release(); }
175 : : // ::com::sun::star::lang::XTypeProvider
176 : : ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw(::com::sun::star::uno::RuntimeException);
177 : : ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw(::com::sun::star::uno::RuntimeException);
178 : : void SAL_CALL createPeer( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XToolkit >& Toolkit, const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer >& Parent ) throw(::com::sun::star::uno::RuntimeException);
179 : : // com::sun::star::awt::XSimpleTabController
180 : : virtual ::sal_Int32 SAL_CALL insertTab() throw (::com::sun::star::uno::RuntimeException);
181 : : virtual void SAL_CALL removeTab( ::sal_Int32 ID ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
182 : :
183 : : virtual void SAL_CALL setTabProps( ::sal_Int32 ID, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue >& Properties ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
184 : : virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue > SAL_CALL getTabProps( ::sal_Int32 ID ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
185 : :
186 : : virtual void SAL_CALL activateTab( ::sal_Int32 ID ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
187 : : virtual ::sal_Int32 SAL_CALL getActiveTabID() throw (::com::sun::star::uno::RuntimeException);
188 : :
189 : : virtual void SAL_CALL addTabListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XTabListener >& Listener ) throw (::com::sun::star::uno::RuntimeException);
190 : : virtual void SAL_CALL removeTabListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XTabListener >& Listener ) throw (::com::sun::star::uno::RuntimeException);
191 : : // XTabListener
192 : : virtual void SAL_CALL inserted( ::sal_Int32 ID ) throw (::com::sun::star::uno::RuntimeException);
193 : : virtual void SAL_CALL removed( ::sal_Int32 ID ) throw (::com::sun::star::uno::RuntimeException);
194 : : virtual void SAL_CALL changed( ::sal_Int32 ID, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue >& Properties ) throw (::com::sun::star::uno::RuntimeException);
195 : : virtual void SAL_CALL activated( ::sal_Int32 ID ) throw (::com::sun::star::uno::RuntimeException);
196 : : virtual void SAL_CALL deactivated( ::sal_Int32 ID ) throw (::com::sun::star::uno::RuntimeException);
197 : : virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& evt ) throw (::com::sun::star::uno::RuntimeException);
198 : : // XComponent
199 : : void SAL_CALL dispose( ) throw(::com::sun::star::uno::RuntimeException);
200 : :
201 : : protected:
202 : : virtual void impl_createControlPeerIfNecessary(
203 : : const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControl >& _rxControl
204 : : );
205 : :
206 : : };
207 : :
208 : :
209 : : class UnoPageModel : public ControlModelContainerBase
210 : : {
211 : : public:
212 : : UnoPageModel( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory );
213 : : ~UnoPageModel();
214 : : UnoPageModel( const UnoPageModel& rModel );
215 : :
216 : : UnoControlModel* Clone() const;
217 : :
218 [ # # ][ # # ]: 0 : DECLIMPL_SERVICEINFO_DERIVED( UnoPageModel, ControlModelContainerBase, szServiceName_UnoPageModel )
219 : :
220 : : virtual ::rtl::OUString SAL_CALL getServiceName() throw(::com::sun::star::uno::RuntimeException);
221 : : virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw( ::com::sun::star::uno::RuntimeException);
222 : :
223 : : // Override the method of parent Class
224 : : virtual sal_Bool SAL_CALL getGroupControl( ) throw (::com::sun::star::uno::RuntimeException);
225 : : protected:
226 : : virtual ::com::sun::star::uno::Any ImplGetDefaultValue( sal_uInt16 nPropId ) const;
227 : : ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper();
228 : :
229 : : };
230 : :
231 : : class UnoPageControl : public ControlContainerBase
232 : : {
233 : : public:
234 : : UnoPageControl( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory );
235 : : ~UnoPageControl();
236 : : ::rtl::OUString GetComponentServiceName();
237 : :
238 : :
239 : : // ::com::sun::star::lang::XServiceInfo
240 [ # # ][ # # ]: 0 : DECLIMPL_SERVICEINFO_DERIVED( UnoPageControl, ControlContainerBase, szServiceName_UnoPageControl )
241 : : };
242 : :
243 : : class UnoFrameModel : public ControlModelContainerBase
244 : : {
245 : : public:
246 : : UnoFrameModel( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory );
247 : : ~UnoFrameModel();
248 : : UnoFrameModel( const UnoFrameModel& rModel );
249 : :
250 : : UnoControlModel* Clone() const;
251 : :
252 [ # # ][ # # ]: 0 : DECLIMPL_SERVICEINFO_DERIVED( UnoFrameModel, ControlModelContainerBase, szServiceName_UnoFrameModel )
253 : :
254 : : virtual ::rtl::OUString SAL_CALL getServiceName() throw(::com::sun::star::uno::RuntimeException);
255 : : virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw( ::com::sun::star::uno::RuntimeException);
256 : :
257 : : protected:
258 : : virtual ::com::sun::star::uno::Any ImplGetDefaultValue( sal_uInt16 nPropId ) const;
259 : : ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper();
260 : : };
261 : :
262 : : class UnoFrameControl : public ControlContainerBase
263 : : {
264 : : protected:
265 : : virtual void ImplSetPosSize( ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControl >& rxCtrl );
266 : : public:
267 : : UnoFrameControl( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory );
268 : : ~UnoFrameControl();
269 : : ::rtl::OUString GetComponentServiceName();
270 : :
271 : : // ::com::sun::star::lang::XServiceInfo
272 [ # # ][ # # ]: 0 : DECLIMPL_SERVICEINFO_DERIVED( UnoFrameControl, ControlContainerBase, szServiceName_UnoPageControl )
273 : : };
274 : :
275 : : #endif // TOOLKIT_DIALOG_CONTROL_HXX
276 : :
277 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|