1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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 INCLUDED_FRAMEWORK_INC_HELPER_UIELEMENTWRAPPERBASE_HXX
21 #define INCLUDED_FRAMEWORK_INC_HELPER_UIELEMENTWRAPPERBASE_HXX
23 #include <macros/generic.hxx>
24 #include <macros/xinterface.hxx>
25 #include <macros/xtypeprovider.hxx>
27 #include <com/sun/star/ui/XUIElement.hpp>
28 #include <com/sun/star/lang/XInitialization.hpp>
29 #include <com/sun/star/lang/XComponent.hpp>
30 #include <com/sun/star/frame/XFrame.hpp>
31 #include <com/sun/star/util/XUpdatable.hpp>
33 #include <rtl/ustring.hxx>
34 #include <cppuhelper/basemutex.hxx>
35 #include <cppuhelper/propshlp.hxx>
36 #include <cppuhelper/implbase4.hxx>
41 typedef ::cppu::WeakImplHelper4
<
42 ::com::sun::star::ui::XUIElement
,
43 ::com::sun::star::lang::XInitialization
,
44 ::com::sun::star::lang::XComponent
,
45 ::com::sun::star::util::XUpdatable
> UIElementWrapperBase_BASE
;
47 class UIElementWrapperBase
: private cppu::BaseMutex
,
48 public ::cppu::OBroadcastHelper
,
49 public ::cppu::OPropertySetHelper
,
50 public UIElementWrapperBase_BASE
56 UIElementWrapperBase( sal_Int16 nType
);
57 virtual ~UIElementWrapperBase();
60 virtual void SAL_CALL
acquire() throw () SAL_OVERRIDE
61 { OWeakObject::acquire(); }
62 virtual void SAL_CALL
release() throw () SAL_OVERRIDE
63 { OWeakObject::release(); }
64 virtual ::com::sun::star::uno::Any SAL_CALL
queryInterface( const ::com::sun::star::uno::Type
& type
) throw ( ::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
67 virtual ::com::sun::star::uno::Sequence
< ::com::sun::star::uno::Type
> SAL_CALL
getTypes( ) throw(::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
70 virtual void SAL_CALL
dispose() throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
= 0;
71 virtual void SAL_CALL
addEventListener( const ::com::sun::star::uno::Reference
< ::com::sun::star::lang::XEventListener
>& xListener
) throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
72 virtual void SAL_CALL
removeEventListener( const ::com::sun::star::uno::Reference
< ::com::sun::star::lang::XEventListener
>& aListener
) throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
75 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
, std::exception
) SAL_OVERRIDE
;
78 virtual void SAL_CALL
update() throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
81 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::frame::XFrame
> SAL_CALL
getFrame() throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
82 virtual OUString SAL_CALL
getResourceURL() throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
83 virtual ::sal_Int16 SAL_CALL
getType() throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
84 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::uno::XInterface
> SAL_CALL
getRealInterface() throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
= 0;
91 virtual sal_Bool SAL_CALL
convertFastPropertyValue ( com::sun::star::uno::Any
& aConvertedValue
,
92 com::sun::star::uno::Any
& aOldValue
,
94 const com::sun::star::uno::Any
& aValue
) throw( com::sun::star::lang::IllegalArgumentException
) SAL_OVERRIDE
;
95 virtual void SAL_CALL
setFastPropertyValue_NoBroadcast( sal_Int32 nHandle
,
96 const com::sun::star::uno::Any
& aValue
) throw( com::sun::star::uno::Exception
, std::exception
) SAL_OVERRIDE
;
97 using cppu::OPropertySetHelper::getFastPropertyValue
;
98 virtual void SAL_CALL
getFastPropertyValue( com::sun::star::uno::Any
& aValue
,
99 sal_Int32 nHandle
) const SAL_OVERRIDE
;
100 virtual ::cppu::IPropertyArrayHelper
& SAL_CALL
getInfoHelper() SAL_OVERRIDE
;
101 virtual ::com::sun::star::uno::Reference
< com::sun::star::beans::XPropertySetInfo
> SAL_CALL
getPropertySetInfo() throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
103 static const ::com::sun::star::uno::Sequence
< ::com::sun::star::beans::Property
> impl_getStaticPropertyDescriptor();
105 ::cppu::OMultiTypeInterfaceContainerHelper m_aListenerContainer
; /// container for ALL Listener
106 OUString m_aResourceURL
;
107 com::sun::star::uno::WeakReference
< com::sun::star::frame::XFrame
> m_xWeakFrame
;
109 bool m_bInitialized
: 1,
113 } // namespace framework
115 #endif // INCLUDED_FRAMEWORK_INC_HELPER_UIELEMENTWRAPPERBASE_HXX
117 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */