Update ooo320-m1
[ooovba.git] / UnoControls / source / inc / framecontrol.hxx
blob8a734dd0a1f526fd216193f27e51cba58abe5b1f
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: framecontrol.hxx,v $
10 * $Revision: 1.6 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef _UNOCONTROLS_FRAMECONTROL_CTRL_HXX
32 #define _UNOCONTROLS_FRAMECONTROL_CTRL_HXX
34 //______________________________________________________________________________________________________________
35 // includes of other projects
36 //______________________________________________________________________________________________________________
38 #include <com/sun/star/frame/XFrameActionListener.hpp>
39 #include <com/sun/star/frame/XComponentLoader.hpp>
40 #include <com/sun/star/frame/XFrame.hpp>
41 #include <com/sun/star/frame/FrameActionEvent.hpp>
42 #include <com/sun/star/frame/FrameAction.hpp>
43 #include <com/sun/star/lang/XServiceName.hpp>
44 #include <com/sun/star/lang/XServiceInfo.hpp>
45 #include <com/sun/star/lang/XConnectionPointContainer.hpp>
46 #include <cppuhelper/propshlp.hxx>
48 //______________________________________________________________________________________________________________
49 // includes of my own project
50 //______________________________________________________________________________________________________________
51 #include "basecontrol.hxx"
52 #include "OConnectionPointContainerHelper.hxx"
54 //______________________________________________________________________________________________________________
55 // namespaces
56 //______________________________________________________________________________________________________________
58 namespace unocontrols{
60 #define UNO3_ANY ::com::sun::star::uno::Any
61 #define UNO3_ILLEGALARGUMENTEXCEPTION ::com::sun::star::lang::IllegalArgumentException
62 #define UNO3_IPROPERTYARRAYHELPER ::cppu::IPropertyArrayHelper
63 #define UNO3_OBROADCASTHELPER ::cppu::OBroadcastHelper
64 #define UNO3_OCONNECTIONPOINTCONTAINERHELPER OConnectionPointContainerHelper
65 #define UNO3_OMULTITYPEINTERFACECONTAINERHELPER ::cppu::OMultiTypeInterfaceContainerHelper
66 #define UNO3_OPROPERTYSETHELPER ::cppu::OPropertySetHelper
67 #define UNO3_OUSTRING ::rtl::OUString
68 #define UNO3_PROPERTY ::com::sun::star::beans::Property
69 #define UNO3_PROPERTYVALUE ::com::sun::star::beans::PropertyValue
70 #define UNO3_REFERENCE ::com::sun::star::uno::Reference
71 #define UNO3_RUNTIMEEXCEPTION ::com::sun::star::uno::RuntimeException
72 #define UNO3_SEQUENCE ::com::sun::star::uno::Sequence
73 #define UNO3_TYPE ::com::sun::star::uno::Type
74 #define UNO3_WINDOWDESCRIPTOR ::com::sun::star::awt::WindowDescriptor
75 #define UNO3_XCONNECTIONPOINT ::com::sun::star::lang::XConnectionPoint
76 #define UNO3_XCONNECTIONPOINTCONTAINER ::com::sun::star::lang::XConnectionPointContainer
77 #define UNO3_XCONTROLMODEL ::com::sun::star::awt::XControlModel
78 #define UNO3_XFRAME ::com::sun::star::frame::XFrame
79 #define UNO3_XGRAPHICS ::com::sun::star::awt::XGraphics
80 #define UNO3_XINTERFACE ::com::sun::star::uno::XInterface
81 #define UNO3_XMULTISERVICEFACTORY ::com::sun::star::lang::XMultiServiceFactory
82 #define UNO3_XPROPERTYSETINFO ::com::sun::star::beans::XPropertySetInfo
83 #define UNO3_XTOOLKIT ::com::sun::star::awt::XToolkit
84 #define UNO3_XWINDOWPEER ::com::sun::star::awt::XWindowPeer
86 //______________________________________________________________________________________________________________
87 // defines
88 //______________________________________________________________________________________________________________
90 #define SERVICENAME_FRAMECONTROL "com.sun.star.frame.FrameControl"
91 #define IMPLEMENTATIONNAME_FRAMECONTROL "stardiv.UnoControls.FrameControl"
92 #define PROPERTYNAME_LOADERARGUMENTS "LoaderArguments"
93 #define PROPERTYNAME_COMPONENTURL "ComponentURL"
94 #define PROPERTYNAME_FRAME "Frame"
95 #define ERRORTEXT_VOSENSHURE "This is an invalid property handle."
96 #define PROPERTY_COUNT 3 // you must count the propertys
97 #define PROPERTYHANDLE_COMPONENTURL 0 // Id must be the index into the array
98 #define PROPERTYHANDLE_FRAME 1
99 #define PROPERTYHANDLE_LOADERARGUMENTS 2
101 //______________________________________________________________________________________________________________
102 // class
103 //______________________________________________________________________________________________________________
105 class FrameControl : public UNO3_XCONTROLMODEL
106 , public UNO3_XCONNECTIONPOINTCONTAINER
107 , public BaseControl // This order is neccessary for right initialization of m_aMutex!
108 , public UNO3_OBROADCASTHELPER
109 , public UNO3_OPROPERTYSETHELPER
112 //______________________________________________________________________________________________________________
113 // public methods
114 //______________________________________________________________________________________________________________
116 public:
118 //__________________________________________________________________________________________________________
119 // construct/destruct
120 //__________________________________________________________________________________________________________
122 /**_________________________________________________________________________________________________________
123 @short
124 @descr
126 @seealso
128 @param
130 @return
132 @onerror
135 FrameControl( const UNO3_REFERENCE< UNO3_XMULTISERVICEFACTORY >& xFactory );
137 /**_________________________________________________________________________________________________________
138 @short
139 @descr
141 @seealso
143 @param
145 @return
147 @onerror
150 virtual ~FrameControl();
152 //__________________________________________________________________________________________________________
153 // XInterface
154 //__________________________________________________________________________________________________________
156 /**_________________________________________________________________________________________________________
157 @short
158 @descr
160 @seealso
162 @param
164 @return
166 @onerror
169 virtual UNO3_ANY SAL_CALL queryInterface( const UNO3_TYPE& aType ) throw( UNO3_RUNTIMEEXCEPTION );
171 /**_______________________________________________________________________________________________________
172 @short increment refcount
173 @descr -
175 @seealso XInterface
176 @seealso release()
178 @param -
180 @return -
182 @onerror A RuntimeException is thrown.
185 virtual void SAL_CALL acquire() throw();
187 /**_______________________________________________________________________________________________________
188 @short decrement refcount
189 @descr -
191 @seealso XInterface
192 @seealso acquire()
194 @param -
196 @return -
198 @onerror A RuntimeException is thrown.
201 virtual void SAL_CALL release() throw();
203 //__________________________________________________________________________________________________________
204 // XTypeProvider
205 //__________________________________________________________________________________________________________
207 /**_________________________________________________________________________________________________________
208 @short
209 @descr
211 @seealso
213 @param
215 @return
217 @onerror
220 virtual UNO3_SEQUENCE< UNO3_TYPE > SAL_CALL getTypes() throw( UNO3_RUNTIMEEXCEPTION );
222 //__________________________________________________________________________________________________________
223 // XAggregation
224 //__________________________________________________________________________________________________________
226 /**_________________________________________________________________________________________________________
227 @short
228 @descr
230 @seealso
232 @param
234 @return
236 @onerror
239 UNO3_ANY SAL_CALL queryAggregation( const UNO3_TYPE& aType ) throw( UNO3_RUNTIMEEXCEPTION );
241 //__________________________________________________________________________________________________________
242 // XControl
243 //__________________________________________________________________________________________________________
245 /**_________________________________________________________________________________________________________
246 @short
247 @descr
249 @seealso
251 @param
253 @return
255 @onerror
258 virtual void SAL_CALL createPeer( const UNO3_REFERENCE< UNO3_XTOOLKIT >& xToolkit ,
259 const UNO3_REFERENCE< UNO3_XWINDOWPEER >& xParent ) throw( UNO3_RUNTIMEEXCEPTION );
261 /**_________________________________________________________________________________________________________
262 @short
263 @descr
265 @seealso
267 @param
269 @return
271 @onerror
274 virtual sal_Bool SAL_CALL setModel( const UNO3_REFERENCE< UNO3_XCONTROLMODEL >& xModel ) throw( UNO3_RUNTIMEEXCEPTION );
276 /**_________________________________________________________________________________________________________
277 @short
278 @descr
280 @seealso
282 @param
284 @return
286 @onerror
289 virtual UNO3_REFERENCE< UNO3_XCONTROLMODEL > SAL_CALL getModel() throw( UNO3_RUNTIMEEXCEPTION );
291 //__________________________________________________________________________________________________________
292 // XComponent
293 //__________________________________________________________________________________________________________
295 /**_________________________________________________________________________________________________________
296 @short
297 @descr
299 @seealso
301 @param
303 @return
305 @onerror
308 virtual void SAL_CALL dispose() throw( UNO3_RUNTIMEEXCEPTION );
310 //__________________________________________________________________________________________________________
311 // XView
312 //__________________________________________________________________________________________________________
314 /**_________________________________________________________________________________________________________
315 @short
316 @descr
318 @seealso
320 @param
322 @return
324 @onerror
327 virtual sal_Bool SAL_CALL setGraphics( const UNO3_REFERENCE< UNO3_XGRAPHICS >& xDevice ) throw( UNO3_RUNTIMEEXCEPTION );
329 /**_________________________________________________________________________________________________________
330 @short
331 @descr
333 @seealso
335 @param
337 @return
339 @onerror
342 virtual UNO3_REFERENCE< UNO3_XGRAPHICS > SAL_CALL getGraphics() throw( UNO3_RUNTIMEEXCEPTION );
344 //__________________________________________________________________________________________________________
345 // XConnectionPointContainer
346 //__________________________________________________________________________________________________________
348 /**_________________________________________________________________________________________________________
349 @short
350 @descr
352 @seealso
354 @param
356 @return
358 @onerror
361 virtual UNO3_SEQUENCE< UNO3_TYPE > SAL_CALL getConnectionPointTypes() throw( UNO3_RUNTIMEEXCEPTION );
363 /**_________________________________________________________________________________________________________
364 @short
365 @descr
367 @seealso
369 @param
371 @return
373 @onerror
376 virtual UNO3_REFERENCE< UNO3_XCONNECTIONPOINT > SAL_CALL queryConnectionPoint( const UNO3_TYPE& aType ) throw( UNO3_RUNTIMEEXCEPTION );
378 /**_________________________________________________________________________________________________________
379 @short
380 @descr
382 @seealso
384 @param
386 @return
388 @onerror
391 virtual void SAL_CALL advise( const UNO3_TYPE& aType ,
392 const UNO3_REFERENCE< UNO3_XINTERFACE >& xListener ) throw( UNO3_RUNTIMEEXCEPTION );
394 /**_________________________________________________________________________________________________________
395 @short
396 @descr
398 @seealso
400 @param
402 @return
404 @onerror
407 virtual void SAL_CALL unadvise( const UNO3_TYPE& aType ,
408 const UNO3_REFERENCE< UNO3_XINTERFACE >& xListener ) throw( UNO3_RUNTIMEEXCEPTION );
410 //__________________________________________________________________________________________________________
411 // impl but public methods to register service!
412 //__________________________________________________________________________________________________________
414 /**_________________________________________________________________________________________________________
415 @short
416 @descr
418 @seealso
420 @param
422 @return
424 @onerror
427 static const UNO3_SEQUENCE< UNO3_OUSTRING > impl_getStaticSupportedServiceNames();
429 /**_________________________________________________________________________________________________________
430 @short
431 @descr
433 @seealso
435 @param
437 @return
439 @onerror
442 static const UNO3_OUSTRING impl_getStaticImplementationName();
444 //______________________________________________________________________________________________________________
445 // protected methods
446 //______________________________________________________________________________________________________________
448 protected:
449 using OPropertySetHelper::getFastPropertyValue;
450 //__________________________________________________________________________________________________________
451 // OPropertySetHelper
452 //__________________________________________________________________________________________________________
454 /**_________________________________________________________________________________________________________
455 @short
456 @descr
458 @seealso
460 @param
462 @return
464 @onerror
467 virtual sal_Bool SAL_CALL convertFastPropertyValue( UNO3_ANY& rConvertedValue ,
468 UNO3_ANY& rOldValue ,
469 sal_Int32 nHandle ,
470 const UNO3_ANY& rValue ) throw( UNO3_ILLEGALARGUMENTEXCEPTION );
472 /**_________________________________________________________________________________________________________
473 @short
474 @descr
476 @seealso
478 @param
480 @return
482 @onerror
485 virtual void SAL_CALL setFastPropertyValue_NoBroadcast( sal_Int32 nHandle ,
486 const UNO3_ANY& rValue ) throw ( ::com::sun::star::uno::Exception );
488 /**_________________________________________________________________________________________________________
489 @short
490 @descr
492 @seealso
494 @param
496 @return
498 @onerror
501 virtual void SAL_CALL getFastPropertyValue( UNO3_ANY& rValue ,
502 sal_Int32 nHandle ) const ;
504 /**_________________________________________________________________________________________________________
505 @short
506 @descr
508 @seealso
510 @param
512 @return
514 @onerror
517 virtual UNO3_IPROPERTYARRAYHELPER& SAL_CALL getInfoHelper();
519 //__________________________________________________________________________________________________________
520 // XPropertySet
521 //__________________________________________________________________________________________________________
523 /**_________________________________________________________________________________________________________
524 @short
525 @descr
527 @seealso
529 @param
531 @return
533 @onerror
536 UNO3_REFERENCE< UNO3_XPROPERTYSETINFO > SAL_CALL getPropertySetInfo() throw( UNO3_RUNTIMEEXCEPTION );
538 //__________________________________________________________________________________________________________
539 // BaseControl
540 //__________________________________________________________________________________________________________
542 /**_________________________________________________________________________________________________________
543 @short
544 @descr
546 @seealso
548 @param
550 @return
552 @onerror
555 virtual UNO3_WINDOWDESCRIPTOR* impl_getWindowDescriptor( const UNO3_REFERENCE< UNO3_XWINDOWPEER >& xParentPeer );
557 //______________________________________________________________________________________________________________
558 // private methods
559 //______________________________________________________________________________________________________________
561 private:
563 /**_________________________________________________________________________________________________________
564 @short
565 @descr
567 @seealso
569 @param
571 @return
573 @onerror
576 void impl_createFrame( const UNO3_REFERENCE< UNO3_XWINDOWPEER >& xPeer ,
577 const UNO3_OUSTRING& sURL ,
578 const UNO3_SEQUENCE< UNO3_PROPERTYVALUE >& seqArguments );
580 /**_________________________________________________________________________________________________________
581 @short
582 @descr
584 @seealso
586 @param
588 @return
590 @onerror
593 void impl_deleteFrame();
595 /**_________________________________________________________________________________________________________
596 @short
597 @descr
599 @seealso
601 @param
603 @return
605 @onerror
608 static const UNO3_SEQUENCE< UNO3_PROPERTY > impl_getStaticPropertyDescriptor();
611 //______________________________________________________________________________________________________________
612 // private variables
613 //______________________________________________________________________________________________________________
615 private:
617 UNO3_REFERENCE< UNO3_XFRAME > m_xFrame ;
618 UNO3_OUSTRING m_sComponentURL ;
619 UNO3_SEQUENCE< UNO3_PROPERTYVALUE > m_seqLoaderArguments ;
620 UNO3_OMULTITYPEINTERFACECONTAINERHELPER m_aInterfaceContainer ;
621 UNO3_OCONNECTIONPOINTCONTAINERHELPER m_aConnectionPointContainer ;
623 }; // class FrameControl
625 } // namespace unocontrols
627 #endif // #ifndef _UNOCONTROLS_FRAMECONTROL_CTRL_HXX