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 __FRAMEWORK_HELPER_UIELEMENTWRAPPERBASE_HXX_
21 #define __FRAMEWORK_HELPER_UIELEMENTWRAPPERBASE_HXX_
23 #include <threadhelp/threadhelpbase.hxx>
24 #include <macros/generic.hxx>
25 #include <macros/xinterface.hxx>
26 #include <macros/xtypeprovider.hxx>
28 #include <com/sun/star/ui/XUIElement.hpp>
29 #include <com/sun/star/lang/XInitialization.hpp>
30 #include <com/sun/star/lang/XComponent.hpp>
31 #include <com/sun/star/frame/XFrame.hpp>
32 #include <com/sun/star/util/XUpdatable.hpp>
34 #include <rtl/ustring.hxx>
35 #include <cppuhelper/propshlp.hxx>
36 #include <cppuhelper/interfacecontainer.hxx>
37 #include <cppuhelper/weak.hxx>
42 class UIElementWrapperBase
: public ::com::sun::star::lang::XTypeProvider
,
43 public ::com::sun::star::ui::XUIElement
,
44 public ::com::sun::star::lang::XInitialization
,
45 public ::com::sun::star::lang::XComponent
,
46 public ::com::sun::star::util::XUpdatable
,
47 protected ThreadHelpBase
,
48 public ::cppu::OBroadcastHelper
,
49 public ::cppu::OPropertySetHelper
,
50 public ::cppu::OWeakObject
52 //-------------------------------------------------------------------------------------------------------------
54 //-------------------------------------------------------------------------------------------------------------
56 UIElementWrapperBase( sal_Int16 nType
);
57 virtual ~UIElementWrapperBase();
60 virtual ::com::sun::star::uno::Any SAL_CALL
queryInterface( const ::com::sun::star::uno::Type
& aType
) throw( ::com::sun::star::uno::RuntimeException
);
61 virtual void SAL_CALL
acquire() throw();
62 virtual void SAL_CALL
release() throw();
65 virtual ::com::sun::star::uno::Sequence
< ::com::sun::star::uno::Type
> SAL_CALL
getTypes() throw( ::com::sun::star::uno::RuntimeException
);
66 virtual ::com::sun::star::uno::Sequence
< sal_Int8
> SAL_CALL
getImplementationId() throw( ::com::sun::star::uno::RuntimeException
);
69 virtual void SAL_CALL
dispose() throw (::com::sun::star::uno::RuntimeException
) = 0;
70 virtual void SAL_CALL
addEventListener( const ::com::sun::star::uno::Reference
< ::com::sun::star::lang::XEventListener
>& xListener
) throw (::com::sun::star::uno::RuntimeException
);
71 virtual void SAL_CALL
removeEventListener( const ::com::sun::star::uno::Reference
< ::com::sun::star::lang::XEventListener
>& aListener
) throw (::com::sun::star::uno::RuntimeException
);
74 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
);
77 virtual void SAL_CALL
update() throw (::com::sun::star::uno::RuntimeException
);
80 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::frame::XFrame
> SAL_CALL
getFrame() throw (::com::sun::star::uno::RuntimeException
);
81 virtual OUString SAL_CALL
getResourceURL() throw (::com::sun::star::uno::RuntimeException
);
82 virtual ::sal_Int16 SAL_CALL
getType() throw (::com::sun::star::uno::RuntimeException
);
83 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::uno::XInterface
> SAL_CALL
getRealInterface() throw (::com::sun::star::uno::RuntimeException
) = 0;
85 //-------------------------------------------------------------------------------------------------------------
87 //-------------------------------------------------------------------------------------------------------------
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
);
95 virtual void SAL_CALL
setFastPropertyValue_NoBroadcast( sal_Int32 nHandle
,
96 const com::sun::star::uno::Any
& aValue
) throw( com::sun::star::uno::Exception
);
97 using cppu::OPropertySetHelper::getFastPropertyValue
;
98 virtual void SAL_CALL
getFastPropertyValue( com::sun::star::uno::Any
& aValue
,
99 sal_Int32 nHandle
) const;
100 virtual ::cppu::IPropertyArrayHelper
& SAL_CALL
getInfoHelper();
101 virtual ::com::sun::star::uno::Reference
< com::sun::star::beans::XPropertySetInfo
> SAL_CALL
getPropertySetInfo() throw (::com::sun::star::uno::RuntimeException
);
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 sal_Bool m_bInitialized
: 1,
113 } // namespace framework
115 #endif // __FRAMEWORK_HELPER_UIELEMENTWRAPPERBASE_HXX_
117 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */