2010-10-27 13:11:31 +01:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
2012-06-21 20:25:33 +01:00
|
|
|
/*
|
|
|
|
* This file is part of the LibreOffice project.
|
|
|
|
*
|
|
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
|
|
*
|
|
|
|
* This file incorporates work covered by the following license notice:
|
|
|
|
*
|
|
|
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
|
|
|
* contributor license agreements. See the NOTICE file distributed
|
|
|
|
* with this work for additional information regarding copyright
|
|
|
|
* ownership. The ASF licenses this file to you under the Apache
|
|
|
|
* License, Version 2.0 (the "License"); you may not use this file
|
|
|
|
* except in compliance with the License. You may obtain a copy of
|
|
|
|
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
|
|
|
|
*/
|
2004-02-25 16:34:40 +00:00
|
|
|
|
2013-10-22 17:03:24 +02:00
|
|
|
#ifndef INCLUDED_FRAMEWORK_INC_HELPER_UICONFIGELEMENTWRAPPERBASE_HXX
|
|
|
|
#define INCLUDED_FRAMEWORK_INC_HELPER_UICONFIGELEMENTWRAPPERBASE_HXX
|
2004-02-25 16:34:40 +00:00
|
|
|
|
|
|
|
#include <threadhelp/threadhelpbase.hxx>
|
|
|
|
#include <macros/generic.hxx>
|
|
|
|
#include <macros/xinterface.hxx>
|
|
|
|
#include <macros/xtypeprovider.hxx>
|
|
|
|
|
2005-03-01 18:25:03 +00:00
|
|
|
#include <com/sun/star/ui/XUIElement.hpp>
|
|
|
|
#include <com/sun/star/ui/XUIElementSettings.hpp>
|
|
|
|
#include <com/sun/star/ui/XUIConfigurationManager.hpp>
|
|
|
|
#include <com/sun/star/ui/XUIConfigurationListener.hpp>
|
2004-02-25 16:34:40 +00:00
|
|
|
#include <com/sun/star/frame/XFrame.hpp>
|
|
|
|
#include <com/sun/star/awt/XMenuBar.hpp>
|
2004-07-06 15:49:43 +00:00
|
|
|
#include <com/sun/star/util/XUpdatable.hpp>
|
2004-02-25 16:34:40 +00:00
|
|
|
#include <com/sun/star/lang/XInitialization.hpp>
|
|
|
|
#include <com/sun/star/lang/XComponent.hpp>
|
|
|
|
|
|
|
|
#include <rtl/ustring.hxx>
|
|
|
|
#include <cppuhelper/propshlp.hxx>
|
2013-07-15 13:47:03 +02:00
|
|
|
#include <cppuhelper/implbase6.hxx>
|
2004-02-25 16:34:40 +00:00
|
|
|
|
|
|
|
namespace framework
|
|
|
|
{
|
|
|
|
|
2013-07-15 13:47:03 +02:00
|
|
|
typedef ::cppu::WeakImplHelper6<
|
|
|
|
::com::sun::star::ui::XUIElement,
|
|
|
|
::com::sun::star::ui::XUIElementSettings,
|
|
|
|
::com::sun::star::lang::XInitialization,
|
|
|
|
::com::sun::star::lang::XComponent,
|
|
|
|
::com::sun::star::util::XUpdatable,
|
|
|
|
::com::sun::star::ui::XUIConfigurationListener > UIConfigElementWrapperBase_BASE;
|
|
|
|
|
|
|
|
class UIConfigElementWrapperBase : protected ThreadHelpBase ,
|
2004-07-06 15:49:43 +00:00
|
|
|
public ::cppu::OBroadcastHelper ,
|
|
|
|
public ::cppu::OPropertySetHelper ,
|
2013-07-15 13:47:03 +02:00
|
|
|
public UIConfigElementWrapperBase_BASE
|
2004-02-25 16:34:40 +00:00
|
|
|
{
|
|
|
|
//-------------------------------------------------------------------------------------------------------------
|
|
|
|
// public methods
|
|
|
|
//-------------------------------------------------------------------------------------------------------------
|
|
|
|
public:
|
2013-05-21 15:01:22 +02:00
|
|
|
UIConfigElementWrapperBase( sal_Int16 nType );
|
2011-02-02 17:05:04 +01:00
|
|
|
virtual ~UIConfigElementWrapperBase();
|
2004-02-25 16:34:40 +00:00
|
|
|
|
2010-04-29 16:27:41 +02:00
|
|
|
// XInterface
|
2013-07-15 13:47:03 +02:00
|
|
|
virtual void SAL_CALL acquire() throw ()
|
|
|
|
{ OWeakObject::acquire(); }
|
|
|
|
virtual void SAL_CALL release() throw ()
|
|
|
|
{ OWeakObject::release(); }
|
|
|
|
virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type& type) throw ( ::com::sun::star::uno::RuntimeException );
|
2010-04-29 16:27:41 +02:00
|
|
|
|
|
|
|
// XTypeProvider
|
2013-07-15 13:47:03 +02:00
|
|
|
virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes( ) throw(::com::sun::star::uno::RuntimeException);
|
2004-02-25 16:34:40 +00:00
|
|
|
|
|
|
|
// XComponent
|
2011-02-02 17:05:04 +01:00
|
|
|
virtual void SAL_CALL dispose() throw (::com::sun::star::uno::RuntimeException) = 0;
|
|
|
|
virtual void SAL_CALL addEventListener( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener >& xListener ) throw (::com::sun::star::uno::RuntimeException);
|
|
|
|
virtual void SAL_CALL removeEventListener( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener >& aListener ) throw (::com::sun::star::uno::RuntimeException);
|
2004-02-25 16:34:40 +00:00
|
|
|
|
|
|
|
// XInitialization
|
2011-02-02 17:05:04 +01:00
|
|
|
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);
|
2004-02-25 16:34:40 +00:00
|
|
|
|
|
|
|
// XUIElementSettings
|
2011-02-02 17:05:04 +01:00
|
|
|
virtual void SAL_CALL updateSettings() throw (::com::sun::star::uno::RuntimeException) = 0;
|
|
|
|
virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexAccess > SAL_CALL getSettings( sal_Bool bWriteable ) throw (::com::sun::star::uno::RuntimeException);
|
|
|
|
virtual void SAL_CALL setSettings( const ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexAccess >& UISettings ) throw (::com::sun::star::uno::RuntimeException);
|
2004-02-25 16:34:40 +00:00
|
|
|
|
|
|
|
// XUIElement
|
2011-02-02 17:05:04 +01:00
|
|
|
virtual ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > SAL_CALL getFrame() throw (::com::sun::star::uno::RuntimeException);
|
2013-04-07 12:06:47 +02:00
|
|
|
virtual OUString SAL_CALL getResourceURL() throw (::com::sun::star::uno::RuntimeException);
|
2011-02-02 17:05:04 +01:00
|
|
|
virtual ::sal_Int16 SAL_CALL getType() throw (::com::sun::star::uno::RuntimeException);
|
|
|
|
virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL getRealInterface() throw (::com::sun::star::uno::RuntimeException) = 0;
|
2004-02-25 16:34:40 +00:00
|
|
|
|
2004-07-06 15:49:43 +00:00
|
|
|
// XUpdatable
|
2011-02-02 17:05:04 +01:00
|
|
|
virtual void SAL_CALL update() throw (::com::sun::star::uno::RuntimeException);
|
2004-07-06 15:49:43 +00:00
|
|
|
|
|
|
|
// XUIConfigurationListener
|
2011-02-02 17:05:04 +01:00
|
|
|
virtual void SAL_CALL elementInserted( const ::com::sun::star::ui::ConfigurationEvent& Event ) throw (::com::sun::star::uno::RuntimeException);
|
|
|
|
virtual void SAL_CALL elementRemoved( const ::com::sun::star::ui::ConfigurationEvent& Event ) throw (::com::sun::star::uno::RuntimeException);
|
|
|
|
virtual void SAL_CALL elementReplaced( const ::com::sun::star::ui::ConfigurationEvent& Event ) throw (::com::sun::star::uno::RuntimeException);
|
2004-07-06 15:49:43 +00:00
|
|
|
|
|
|
|
// XEventListener
|
2006-06-19 09:54:50 +00:00
|
|
|
using cppu::OPropertySetHelper::disposing;
|
2011-02-02 17:05:04 +01:00
|
|
|
virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& aEvent ) throw(::com::sun::star::uno::RuntimeException);
|
2004-07-06 15:49:43 +00:00
|
|
|
|
2004-02-25 16:34:40 +00:00
|
|
|
//-------------------------------------------------------------------------------------------------------------
|
|
|
|
// protected methods
|
|
|
|
//-------------------------------------------------------------------------------------------------------------
|
|
|
|
protected:
|
|
|
|
|
|
|
|
// OPropertySetHelper
|
2011-02-02 17:05:04 +01:00
|
|
|
virtual sal_Bool SAL_CALL convertFastPropertyValue ( com::sun::star::uno::Any& aConvertedValue ,
|
2004-02-25 16:34:40 +00:00
|
|
|
com::sun::star::uno::Any& aOldValue ,
|
|
|
|
sal_Int32 nHandle ,
|
|
|
|
const com::sun::star::uno::Any& aValue ) throw( com::sun::star::lang::IllegalArgumentException );
|
2011-02-02 17:05:04 +01:00
|
|
|
virtual void SAL_CALL setFastPropertyValue_NoBroadcast( sal_Int32 nHandle ,
|
2004-02-25 16:34:40 +00:00
|
|
|
const com::sun::star::uno::Any& aValue ) throw( com::sun::star::uno::Exception );
|
2006-06-19 09:54:50 +00:00
|
|
|
using cppu::OPropertySetHelper::getFastPropertyValue;
|
2011-02-02 17:05:04 +01:00
|
|
|
virtual void SAL_CALL getFastPropertyValue( com::sun::star::uno::Any& aValue ,
|
2004-02-25 16:34:40 +00:00
|
|
|
sal_Int32 nHandle ) const;
|
2011-02-02 17:05:04 +01:00
|
|
|
virtual ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper();
|
|
|
|
virtual ::com::sun::star::uno::Reference< com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() throw (::com::sun::star::uno::RuntimeException);
|
2004-02-25 16:34:40 +00:00
|
|
|
|
2011-02-02 17:05:04 +01:00
|
|
|
virtual void impl_fillNewData();
|
2009-09-08 04:57:32 +00:00
|
|
|
|
2011-02-02 17:05:04 +01:00
|
|
|
static const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::Property > impl_getStaticPropertyDescriptor();
|
2004-02-25 16:34:40 +00:00
|
|
|
|
|
|
|
sal_Int16 m_nType;
|
2006-12-19 13:01:18 +00:00
|
|
|
bool m_bPersistent : 1,
|
2004-02-25 16:34:40 +00:00
|
|
|
m_bInitialized : 1,
|
2004-07-06 15:49:43 +00:00
|
|
|
m_bConfigListener : 1,
|
|
|
|
m_bConfigListening : 1,
|
2005-03-15 08:32:42 +00:00
|
|
|
m_bDisposed : 1,
|
|
|
|
m_bNoClose : 1;
|
2013-05-21 15:01:22 +02:00
|
|
|
OUString m_aResourceURL;
|
2005-03-15 08:32:42 +00:00
|
|
|
com::sun::star::uno::Reference< ::com::sun::star::ui::XUIConfigurationManager > m_xConfigSource;
|
2004-02-25 16:34:40 +00:00
|
|
|
com::sun::star::uno::Reference< com::sun::star::container::XIndexAccess > m_xConfigData;
|
|
|
|
com::sun::star::uno::WeakReference< com::sun::star::frame::XFrame > m_xWeakFrame;
|
|
|
|
com::sun::star::uno::Reference< com::sun::star::awt::XMenuBar > m_xMenuBar;
|
|
|
|
::cppu::OMultiTypeInterfaceContainerHelper m_aListenerContainer; /// container for ALL Listener
|
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace framework
|
|
|
|
|
2013-10-22 17:03:24 +02:00
|
|
|
#endif // INCLUDED_FRAMEWORK_INC_HELPER_UICONFIGELEMENTWRAPPERBASE_HXX
|
2010-10-27 13:11:31 +01:00
|
|
|
|
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|