summaryrefslogtreecommitdiff
path: root/framework/source/uielement/menubarwrapper.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'framework/source/uielement/menubarwrapper.cxx')
-rw-r--r--framework/source/uielement/menubarwrapper.cxx92
1 files changed, 63 insertions, 29 deletions
diff --git a/framework/source/uielement/menubarwrapper.cxx b/framework/source/uielement/menubarwrapper.cxx
index 48700304f72d..6342f63cf637 100644
--- a/framework/source/uielement/menubarwrapper.cxx
+++ b/framework/source/uielement/menubarwrapper.cxx
@@ -26,6 +26,8 @@
#include <com/sun/star/util/URLTransformer.hpp>
#include <comphelper/sequence.hxx>
+#include <cppuhelper/typeprovider.hxx>
+#include <cppuhelper/queryinterface.hxx>
#include <toolkit/awt/vclxmenu.hxx>
#include <vcl/svapp.hxx>
@@ -42,35 +44,67 @@ using namespace ::com::sun::star::ui;
namespace framework
{
-// XInterface, XTypeProvider
-DEFINE_XINTERFACE_11 ( MenuBarWrapper ,
- UIConfigElementWrapperBase ,
- DIRECT_INTERFACE( css::lang::XTypeProvider ),
- DIRECT_INTERFACE( css::ui::XUIElement ),
- DIRECT_INTERFACE( css::ui::XUIElementSettings ),
- DIRECT_INTERFACE( css::beans::XMultiPropertySet ),
- DIRECT_INTERFACE( css::beans::XFastPropertySet ),
- DIRECT_INTERFACE( css::beans::XPropertySet ),
- DIRECT_INTERFACE( css::lang::XInitialization ),
- DIRECT_INTERFACE( css::lang::XComponent ),
- DIRECT_INTERFACE( css::util::XUpdatable ),
- DIRECT_INTERFACE( css::ui::XUIConfigurationListener ),
- DERIVED_INTERFACE( css::container::XNameAccess, css::container::XElementAccess )
- )
-
-DEFINE_XTYPEPROVIDER_11 ( MenuBarWrapper ,
- css::lang::XTypeProvider ,
- css::ui::XUIElement ,
- css::ui::XUIElementSettings ,
- css::beans::XMultiPropertySet ,
- css::beans::XFastPropertySet ,
- css::beans::XPropertySet ,
- css::lang::XInitialization ,
- css::lang::XComponent ,
- css::util::XUpdatable ,
- css::ui::XUIConfigurationListener ,
- css::container::XNameAccess
- )
+void SAL_CALL MenuBarWrapper::acquire() throw() \
+{ \
+ /* Don't use mutex in methods of XInterface! */ \
+ UIConfigElementWrapperBase::acquire(); \
+} \
+ \
+void SAL_CALL MenuBarWrapper::release() throw() \
+{ \
+ /* Don't use mutex in methods of XInterface! */ \
+ UIConfigElementWrapperBase::release(); \
+}
+
+css::uno::Any SAL_CALL MenuBarWrapper::queryInterface( const css::uno::Type& aType )
+{
+ /* Attention: Don't use mutex or guard in this method!!! Is a method of XInterface. */
+ /* Ask for my own supported interfaces ... */
+ css::uno::Any aReturn = ::cppu::queryInterface( aType,
+ static_cast< css::lang::XTypeProvider* >( this ),
+ static_cast< css::ui::XUIElement* >( this ),
+ static_cast< css::ui::XUIElementSettings* >( this ),
+ static_cast< css::beans::XMultiPropertySet* >( this ),
+ static_cast< css::beans::XFastPropertySet* >( this ),
+ static_cast< css::beans::XPropertySet* >( this ),
+ static_cast< css::lang::XInitialization* >( this ),
+ static_cast< css::lang::XComponent* >( this ),
+ static_cast< css::util::XUpdatable* >( this ),
+ static_cast< css::ui::XUIConfigurationListener* >( this ),
+ static_cast< css::container::XNameAccess* >( static_cast< css::container::XElementAccess* >( this ) )
+ );
+ /* If searched interface not supported by this class ... */
+ if ( !aReturn.hasValue() )
+ {
+ /* ... ask baseclass for interfaces! */
+ aReturn = UIConfigElementWrapperBase::queryInterface( aType );
+ }
+ /* Return result of this search. */
+ return aReturn;
+}
+
+css::uno::Sequence< sal_Int8 > SAL_CALL MenuBarWrapper::getImplementationId()
+{
+ return css::uno::Sequence<sal_Int8>();
+}
+
+css::uno::Sequence< css::uno::Type > SAL_CALL MenuBarWrapper::getTypes()
+{
+ /* Attention: "TYPES" will expand to "(...)"! */
+ static cppu::OTypeCollection ourTypeCollection {
+ cppu::UnoType<css::lang::XTypeProvider>::get() ,
+ cppu::UnoType<css::ui::XUIElement>::get() ,
+ cppu::UnoType<css::ui::XUIElementSettings>::get() ,
+ cppu::UnoType<css::beans::XMultiPropertySet>::get() ,
+ cppu::UnoType<css::beans::XFastPropertySet>::get() ,
+ cppu::UnoType<css::beans::XPropertySet>::get() ,
+ cppu::UnoType<css::lang::XInitialization>::get() ,
+ cppu::UnoType<css::lang::XComponent>::get() ,
+ cppu::UnoType<css::util::XUpdatable>::get() ,
+ cppu::UnoType<css::ui::XUIConfigurationListener>::get() ,
+ cppu::UnoType<css::container::XNameAccess>::get() };
+ return ourTypeCollection.getTypes();
+}
MenuBarWrapper::MenuBarWrapper(
const css::uno::Reference< css::uno::XComponentContext >& rxContext