bump product version to 4.1.6.2
[LibreOffice.git] / UnoControls / source / inc / framecontrol.hxx
blob8da8c67e1c15b12fc33bd74099cbab8a78fe700e
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #ifndef _UNOCONTROLS_FRAMECONTROL_CTRL_HXX
21 #define _UNOCONTROLS_FRAMECONTROL_CTRL_HXX
23 #include <com/sun/star/frame/XFrameActionListener.hpp>
24 #include <com/sun/star/frame/XComponentLoader.hpp>
25 #include <com/sun/star/frame/XFrame2.hpp>
26 #include <com/sun/star/frame/FrameActionEvent.hpp>
27 #include <com/sun/star/frame/FrameAction.hpp>
28 #include <com/sun/star/lang/XServiceName.hpp>
29 #include <com/sun/star/lang/XServiceInfo.hpp>
30 #include <com/sun/star/lang/XConnectionPointContainer.hpp>
31 #include <cppuhelper/propshlp.hxx>
33 #include "basecontrol.hxx"
34 #include "OConnectionPointContainerHelper.hxx"
36 //______________________________________________________________________________________________________________
37 // namespaces
38 //______________________________________________________________________________________________________________
40 namespace unocontrols{
42 #define SERVICENAME_FRAMECONTROL "com.sun.star.frame.FrameControl"
43 #define IMPLEMENTATIONNAME_FRAMECONTROL "stardiv.UnoControls.FrameControl"
44 #define PROPERTYNAME_LOADERARGUMENTS "LoaderArguments"
45 #define PROPERTYNAME_COMPONENTURL "ComponentURL"
46 #define PROPERTYNAME_FRAME "Frame"
47 #define ERRORTEXT_VOSENSHURE "This is an invalid property handle."
48 #define PROPERTY_COUNT 3 // you must count the propertys
49 #define PROPERTYHANDLE_COMPONENTURL 0 // Id must be the index into the array
50 #define PROPERTYHANDLE_FRAME 1
51 #define PROPERTYHANDLE_LOADERARGUMENTS 2
53 //______________________________________________________________________________________________________________
54 // class
55 //______________________________________________________________________________________________________________
57 class FrameControl : public ::com::sun::star::awt::XControlModel
58 , public ::com::sun::star::lang::XConnectionPointContainer
59 , public BaseControl // This order is necessary for right initialization of m_aMutex!
60 , public ::cppu::OBroadcastHelper
61 , public ::cppu::OPropertySetHelper
64 //______________________________________________________________________________________________________________
65 // public methods
66 //______________________________________________________________________________________________________________
68 public:
70 //__________________________________________________________________________________________________________
71 // construct/destruct
72 //__________________________________________________________________________________________________________
74 /**_________________________________________________________________________________________________________
75 @short
76 @descr
78 @seealso
80 @param
82 @return
84 @onerror
87 FrameControl( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext );
89 /**_________________________________________________________________________________________________________
90 @short
91 @descr
93 @seealso
95 @param
97 @return
99 @onerror
102 virtual ~FrameControl();
104 //__________________________________________________________________________________________________________
105 // XInterface
106 //__________________________________________________________________________________________________________
108 /**_________________________________________________________________________________________________________
109 @short
110 @descr
112 @seealso
114 @param
116 @return
118 @onerror
121 virtual ::com::sun::star::uno::Any SAL_CALL queryInterface(
122 const ::com::sun::star::uno::Type& aType
123 ) throw( ::com::sun::star::uno::RuntimeException );
125 /**_______________________________________________________________________________________________________
126 @short increment refcount
127 @descr -
129 @seealso XInterface
130 @seealso release()
132 @param -
134 @return -
136 @onerror A RuntimeException is thrown.
139 virtual void SAL_CALL acquire() throw();
141 /**_______________________________________________________________________________________________________
142 @short decrement refcount
143 @descr -
145 @seealso XInterface
146 @seealso acquire()
148 @param -
150 @return -
152 @onerror A RuntimeException is thrown.
155 virtual void SAL_CALL release() throw();
157 //__________________________________________________________________________________________________________
158 // XTypeProvider
159 //__________________________________________________________________________________________________________
161 /**_________________________________________________________________________________________________________
162 @short
163 @descr
165 @seealso
167 @param
169 @return
171 @onerror
174 virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes()
175 throw( ::com::sun::star::uno::RuntimeException );
177 //__________________________________________________________________________________________________________
178 // XAggregation
179 //__________________________________________________________________________________________________________
181 /**_________________________________________________________________________________________________________
182 @short
183 @descr
185 @seealso
187 @param
189 @return
191 @onerror
194 ::com::sun::star::uno::Any SAL_CALL queryAggregation(
195 const ::com::sun::star::uno::Type& aType
196 ) throw( ::com::sun::star::uno::RuntimeException );
198 //__________________________________________________________________________________________________________
199 // XControl
200 //__________________________________________________________________________________________________________
202 /**_________________________________________________________________________________________________________
203 @short
204 @descr
206 @seealso
208 @param
210 @return
212 @onerror
215 virtual void SAL_CALL createPeer(
216 const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XToolkit >& xToolkit ,
217 const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer >& xParent
218 ) throw ( ::com::sun::star::uno::RuntimeException );
220 /**_________________________________________________________________________________________________________
221 @short
222 @descr
224 @seealso
226 @param
228 @return
230 @onerror
233 virtual sal_Bool SAL_CALL setModel(
234 const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel >& xModel
235 ) throw( ::com::sun::star::uno::RuntimeException );
237 /**_________________________________________________________________________________________________________
238 @short
239 @descr
241 @seealso
243 @param
245 @return
247 @onerror
250 virtual ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel > SAL_CALL getModel()
251 throw( ::com::sun::star::uno::RuntimeException );
253 //__________________________________________________________________________________________________________
254 // XComponent
255 //__________________________________________________________________________________________________________
257 /**_________________________________________________________________________________________________________
258 @short
259 @descr
261 @seealso
263 @param
265 @return
267 @onerror
270 virtual void SAL_CALL dispose() throw( ::com::sun::star::uno::RuntimeException );
272 //__________________________________________________________________________________________________________
273 // XView
274 //__________________________________________________________________________________________________________
276 /**_________________________________________________________________________________________________________
277 @short
278 @descr
280 @seealso
282 @param
284 @return
286 @onerror
289 virtual sal_Bool SAL_CALL setGraphics(
290 const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XGraphics >& xDevice
291 ) throw( ::com::sun::star::uno::RuntimeException );
293 /**_________________________________________________________________________________________________________
294 @short
295 @descr
297 @seealso
299 @param
301 @return
303 @onerror
306 virtual ::com::sun::star::uno::Reference< ::com::sun::star::awt::XGraphics > SAL_CALL getGraphics()
307 throw( ::com::sun::star::uno::RuntimeException );
309 //__________________________________________________________________________________________________________
310 // XConnectionPointContainer
311 //__________________________________________________________________________________________________________
313 /**_________________________________________________________________________________________________________
314 @short
315 @descr
317 @seealso
319 @param
321 @return
323 @onerror
326 virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getConnectionPointTypes()
327 throw( ::com::sun::star::uno::RuntimeException );
329 /**_________________________________________________________________________________________________________
330 @short
331 @descr
333 @seealso
335 @param
337 @return
339 @onerror
342 virtual ::com::sun::star::uno::Reference< ::com::sun::star::lang::XConnectionPoint > SAL_CALL queryConnectionPoint(
343 const ::com::sun::star::uno::Type& aType
344 ) throw ( ::com::sun::star::uno::RuntimeException );
346 /**_________________________________________________________________________________________________________
347 @short
348 @descr
350 @seealso
352 @param
354 @return
356 @onerror
359 virtual void SAL_CALL advise(
360 const ::com::sun::star::uno::Type& aType ,
361 const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& xListener
362 ) throw( ::com::sun::star::uno::RuntimeException );
364 /**_________________________________________________________________________________________________________
365 @short
366 @descr
368 @seealso
370 @param
372 @return
374 @onerror
377 virtual void SAL_CALL unadvise(
378 const ::com::sun::star::uno::Type& aType ,
379 const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& xListener
380 ) throw( ::com::sun::star::uno::RuntimeException );
382 //__________________________________________________________________________________________________________
383 // impl but public methods to register service!
384 //__________________________________________________________________________________________________________
386 /**_________________________________________________________________________________________________________
387 @short
388 @descr
390 @seealso
392 @param
394 @return
396 @onerror
399 static const ::com::sun::star::uno::Sequence< OUString > impl_getStaticSupportedServiceNames();
401 /**_________________________________________________________________________________________________________
402 @short
403 @descr
405 @seealso
407 @param
409 @return
411 @onerror
414 static const OUString impl_getStaticImplementationName();
416 //______________________________________________________________________________________________________________
417 // protected methods
418 //______________________________________________________________________________________________________________
420 protected:
421 using OPropertySetHelper::getFastPropertyValue;
422 //__________________________________________________________________________________________________________
423 // OPropertySetHelper
424 //__________________________________________________________________________________________________________
426 /**_________________________________________________________________________________________________________
427 @short
428 @descr
430 @seealso
432 @param
434 @return
436 @onerror
439 virtual sal_Bool SAL_CALL convertFastPropertyValue(
440 ::com::sun::star::uno::Any& rConvertedValue ,
441 ::com::sun::star::uno::Any& rOldValue ,
442 sal_Int32 nHandle ,
443 const ::com::sun::star::uno::Any& rValue
444 ) throw( ::com::sun::star::lang::IllegalArgumentException );
446 /**_________________________________________________________________________________________________________
447 @short
448 @descr
450 @seealso
452 @param
454 @return
456 @onerror
459 virtual void SAL_CALL setFastPropertyValue_NoBroadcast(
460 sal_Int32 nHandle ,
461 const ::com::sun::star::uno::Any& rValue
462 ) throw ( ::com::sun::star::uno::Exception );
464 /**_________________________________________________________________________________________________________
465 @short
466 @descr
468 @seealso
470 @param
472 @return
474 @onerror
477 virtual void SAL_CALL getFastPropertyValue( ::com::sun::star::uno::Any& rValue ,
478 sal_Int32 nHandle ) const ;
480 /**_________________________________________________________________________________________________________
481 @short
482 @descr
484 @seealso
486 @param
488 @return
490 @onerror
493 virtual ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper();
495 //__________________________________________________________________________________________________________
496 // XPropertySet
497 //__________________________________________________________________________________________________________
499 /**_________________________________________________________________________________________________________
500 @short
501 @descr
503 @seealso
505 @param
507 @return
509 @onerror
512 ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo()
513 throw( ::com::sun::star::uno::RuntimeException );
515 //__________________________________________________________________________________________________________
516 // BaseControl
517 //__________________________________________________________________________________________________________
519 /**_________________________________________________________________________________________________________
520 @short
521 @descr
523 @seealso
525 @param
527 @return
529 @onerror
532 virtual ::com::sun::star::awt::WindowDescriptor* impl_getWindowDescriptor(
533 const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer >& xParentPeer
536 //______________________________________________________________________________________________________________
537 // private methods
538 //______________________________________________________________________________________________________________
540 private:
542 /**_________________________________________________________________________________________________________
543 @short
544 @descr
546 @seealso
548 @param
550 @return
552 @onerror
555 void impl_createFrame( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer >& xPeer ,
556 const OUString& sURL ,
557 const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& seqArguments );
559 /**_________________________________________________________________________________________________________
560 @short
561 @descr
563 @seealso
565 @param
567 @return
569 @onerror
572 void impl_deleteFrame();
574 /**_________________________________________________________________________________________________________
575 @short
576 @descr
578 @seealso
580 @param
582 @return
584 @onerror
587 static const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::Property > impl_getStaticPropertyDescriptor();
590 //______________________________________________________________________________________________________________
591 // private variables
592 //______________________________________________________________________________________________________________
594 private:
596 ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame2 > m_xFrame ;
597 OUString m_sComponentURL ;
598 ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > m_seqLoaderArguments ;
599 ::cppu::OMultiTypeInterfaceContainerHelper m_aInterfaceContainer ;
600 OConnectionPointContainerHelper m_aConnectionPointContainer ;
602 }; // class FrameControl
604 } // namespace unocontrols
606 #endif // #ifndef _UNOCONTROLS_FRAMECONTROL_CTRL_HXX
608 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */