1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: uielementwrapperbase.hxx,v $
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 __FRAMEWORK_HELPER_UIELEMENTWRAPPERBASE_HXX_
32 #define __FRAMEWORK_HELPER_UIELEMENTWRAPPERBASE_HXX_
34 //_________________________________________________________________________________________________________________
36 //_________________________________________________________________________________________________________________
38 #include <threadhelp/threadhelpbase.hxx>
39 #include <macros/generic.hxx>
40 #include <macros/xinterface.hxx>
41 #include <macros/xtypeprovider.hxx>
43 //_________________________________________________________________________________________________________________
45 //_________________________________________________________________________________________________________________
46 #include <com/sun/star/ui/XUIElement.hpp>
47 #include <com/sun/star/lang/XInitialization.hpp>
48 #include <com/sun/star/lang/XComponent.hpp>
49 #include <com/sun/star/frame/XFrame.hpp>
50 #include <com/sun/star/util/XUpdatable.hpp>
52 //_________________________________________________________________________________________________________________
54 //_________________________________________________________________________________________________________________
55 #include <rtl/ustring.hxx>
56 #include <cppuhelper/propshlp.hxx>
57 #include <cppuhelper/interfacecontainer.hxx>
58 #include <cppuhelper/weak.hxx>
63 class UIElementWrapperBase
: public ::com::sun::star::lang::XTypeProvider
,
64 public ::com::sun::star::ui::XUIElement
,
65 public ::com::sun::star::lang::XInitialization
,
66 public ::com::sun::star::lang::XComponent
,
67 public ::com::sun::star::util::XUpdatable
,
68 protected ThreadHelpBase
,
69 public ::cppu::OBroadcastHelper
,
70 public ::cppu::OPropertySetHelper
,
71 public ::cppu::OWeakObject
73 //-------------------------------------------------------------------------------------------------------------
75 //-------------------------------------------------------------------------------------------------------------
77 UIElementWrapperBase( sal_Int16 nType
);
78 virtual ~UIElementWrapperBase();
80 //---------------------------------------------------------------------------------------------------------
81 // XInterface, XTypeProvider
82 //---------------------------------------------------------------------------------------------------------
83 FWK_DECLARE_XINTERFACE
84 FWK_DECLARE_XTYPEPROVIDER
87 virtual void SAL_CALL
dispose() throw (::com::sun::star::uno::RuntimeException
) = 0;
88 virtual void SAL_CALL
addEventListener( const ::com::sun::star::uno::Reference
< ::com::sun::star::lang::XEventListener
>& xListener
) throw (::com::sun::star::uno::RuntimeException
);
89 virtual void SAL_CALL
removeEventListener( const ::com::sun::star::uno::Reference
< ::com::sun::star::lang::XEventListener
>& aListener
) throw (::com::sun::star::uno::RuntimeException
);
92 virtual void SAL_CALL
initialize( const ::com::sun::star::uno::Sequence
< ::com::sun::star::uno::Any
>& aArguments
) throw (::com::sun::star::uno::Exception
, ::com::sun::star::uno::RuntimeException
);
95 virtual void SAL_CALL
update() throw (::com::sun::star::uno::RuntimeException
);
98 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::uno::XInterface
> SAL_CALL
getRealInterface() throw (::com::sun::star::uno::RuntimeException
) = 0;
100 //-------------------------------------------------------------------------------------------------------------
102 //-------------------------------------------------------------------------------------------------------------
105 // OPropertySetHelper
106 virtual sal_Bool SAL_CALL
convertFastPropertyValue ( com::sun::star::uno::Any
& aConvertedValue
,
107 com::sun::star::uno::Any
& aOldValue
,
109 const com::sun::star::uno::Any
& aValue
) throw( com::sun::star::lang::IllegalArgumentException
);
110 virtual void SAL_CALL
setFastPropertyValue_NoBroadcast( sal_Int32 nHandle
,
111 const com::sun::star::uno::Any
& aValue
) throw( com::sun::star::uno::Exception
);
112 using cppu::OPropertySetHelper::getFastPropertyValue
;
113 virtual void SAL_CALL
getFastPropertyValue( com::sun::star::uno::Any
& aValue
,
114 sal_Int32 nHandle
) const;
115 virtual ::cppu::IPropertyArrayHelper
& SAL_CALL
getInfoHelper();
116 virtual ::com::sun::star::uno::Reference
< com::sun::star::beans::XPropertySetInfo
> SAL_CALL
getPropertySetInfo() throw (::com::sun::star::uno::RuntimeException
);
118 static const ::com::sun::star::uno::Sequence
< ::com::sun::star::beans::Property
> impl_getStaticPropertyDescriptor();
120 ::cppu::OMultiTypeInterfaceContainerHelper m_aListenerContainer
; /// container for ALL Listener
121 rtl::OUString m_aResourceURL
;
122 com::sun::star::uno::WeakReference
< com::sun::star::frame::XFrame
> m_xWeakFrame
;
124 sal_Bool m_bInitialized
: 1,
128 } // namespace framework
130 #endif // __FRAMEWORK_HELPER_UIELEMENTWRAPPERBASE_HXX_