diff options
author | Kurt Zenker <kz@openoffice.org> | 2008-03-05 16:21:03 +0000 |
---|---|---|
committer | Kurt Zenker <kz@openoffice.org> | 2008-03-05 16:21:03 +0000 |
commit | 81293104aee3fbce2671bda6c1ca2fdb0136b0fe (patch) | |
tree | 5feb9b6e4569e2cd36262e3fcf751199c1e568c5 /framework/inc/helper/tagwindowasmodified.hxx | |
parent | cd334585e860a0dcf8cc58291a8f4a822c51144e (diff) |
INTEGRATION: CWS aquavcl05_DEV300 (1.1.2); FILE ADDED
2008/02/05 15:34:43 as 1.1.2.1: #i85727# tag frame window if model was modified
Diffstat (limited to 'framework/inc/helper/tagwindowasmodified.hxx')
-rw-r--r-- | framework/inc/helper/tagwindowasmodified.hxx | 200 |
1 files changed, 200 insertions, 0 deletions
diff --git a/framework/inc/helper/tagwindowasmodified.hxx b/framework/inc/helper/tagwindowasmodified.hxx new file mode 100644 index 000000000000..af0853fdac28 --- /dev/null +++ b/framework/inc/helper/tagwindowasmodified.hxx @@ -0,0 +1,200 @@ +/************************************************************************* + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: tagwindowasmodified.hxx,v $ + * + * $Revision: 1.2 $ + * + * last change: $Author: kz $ $Date: 2008-03-05 17:21:03 $ + * + * The Contents of this file are made available subject to + * the terms of GNU Lesser General Public License Version 2.1. + * + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2005 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + ************************************************************************/ + +#ifndef __FRAMEWORK_HELPER_TAGWINDOWASMODIFIED_HXX_ +#define __FRAMEWORK_HELPER_TAGWINDOWASMODIFIED_HXX_ + +//_________________________________________________________________________________________________________________ +// my own includes +//_________________________________________________________________________________________________________________ + +#ifndef __FRAMEWORK_THREADHELP_THREADHELPBASE_HXX_ +#include <threadhelp/threadhelpbase.hxx> +#endif + +#ifndef __FRAMEWORK_MACROS_DEBUG_HXX_ +#include <macros/debug.hxx> +#endif + +#ifndef __FRAMEWORK_MACROS_XINTERFACE_HXX_ +#include <macros/xinterface.hxx> +#endif + +#ifndef __FRAMEWORK_MACROS_XTYPEPROVIDER_HXX_ +#include <macros/xtypeprovider.hxx> +#endif + +#ifndef __FRAMEWORK_GENERAL_H_ +#include <general.h> +#endif + +//_________________________________________________________________________________________________________________ +// interface includes +//_________________________________________________________________________________________________________________ + +#ifndef _COM_SUN_STAR_LANG_XMULTISERVICEFACTORY_HPP_ +#include <com/sun/star/lang/XMultiServiceFactory.hpp> +#endif + +#ifndef _COM_SUN_STAR_LANG_XINITIALIZATION_HPP_ +#include <com/sun/star/lang/XInitialization.hpp> +#endif + +#ifndef _COM_SUN_STAR_FRAME_XFRAME_HPP_ +#include <com/sun/star/frame/XFrame.hpp> +#endif + +#ifndef _COM_SUN_STAR_UTIL_XMODIFYLISTENER_HPP_ +#include <com/sun/star/util/XModifyListener.hpp> +#endif + +#ifndef _COM_SUN_STAR_LANG_XEVENTLISTENER_HPP_ +#include <com/sun/star/lang/XEventListener.hpp> +#endif + +#ifndef _COM_SUN_STAR_FRAME_XFRAMEACTIONLISTENER_HPP_ +#include <com/sun/star/frame/XFrameActionListener.hpp> +#endif + +//_________________________________________________________________________________________________________________ +// other includes +//_________________________________________________________________________________________________________________ + +#ifndef _CPPUHELPER_WEAK_HXX_ +#include <cppuhelper/weak.hxx> +#endif + +//_________________________________________________________________________________________________________________ +// const +//_________________________________________________________________________________________________________________ + +//_________________________________________________________________________________________________________________ +// namespace +//_________________________________________________________________________________________________________________ + +namespace framework{ + +//_________________________________________________________________________________________________________________ +// declarations +//_________________________________________________________________________________________________________________ + +/*-************************************************************************************************************//** + @short listen for modify events on model and tag frame container window so it can react accordingly + @descr Used e.g. by our MAC port where such state is shown seperately on some controls of the + title bar. + + @base ThreadHelpBase + guarantee right initialized lock member during startup of instances of this class. + + @base OWeakObject + implements ref counting for this class. + + @devstatus draft + @threadsafe yes + @modified as96863 +*//*-*************************************************************************************************************/ +class TagWindowAsModified : // interfaces + public css::lang::XTypeProvider, + public css::lang::XInitialization, + public css::frame::XFrameActionListener, // => XEventListener + public css::util::XModifyListener, // => XEventListener + // baseclasses (order neccessary for right initialization!) + private ThreadHelpBase, + public ::cppu::OWeakObject +{ + //________________________________ + // member + + private: + + /// may we need an uno service manager to create own services + css::uno::Reference< css::lang::XMultiServiceFactory > m_xSMGR; + + /// reference to the frame, where we listen for new loaded documents for updating our own xModel reference + css::uno::WeakReference< css::frame::XFrame > m_xFrame; + + /// reference to the frame container window, where we must set the tag + css::uno::WeakReference< css::awt::XWindow > m_xWindow; + + /// we list on the model for modify events + css::uno::WeakReference< css::frame::XModel > m_xModel; + + //________________________________ + // interface + + public: + + //____________________________ + // ctor/dtor + TagWindowAsModified(const css::uno::Reference< css::lang::XMultiServiceFactory >& xSMGR); + virtual ~TagWindowAsModified( ); + + //____________________________ + // XInterface, XTypeProvider + FWK_DECLARE_XINTERFACE + FWK_DECLARE_XTYPEPROVIDER + + //____________________________ + // XInitialization + virtual void SAL_CALL initialize(const css::uno::Sequence< css::uno::Any >& lArguments) + throw(css::uno::Exception , + css::uno::RuntimeException); + + //____________________________ + // XModifyListener + virtual void SAL_CALL modified(const css::lang::EventObject& aEvent) + throw(css::uno::RuntimeException); + + //____________________________ + // XFrameActionListener + virtual void SAL_CALL frameAction(const css::frame::FrameActionEvent& aEvent) + throw(css::uno::RuntimeException); + + //____________________________ + // XEventListener + virtual void SAL_CALL disposing(const css::lang::EventObject& aEvent) + throw(css::uno::RuntimeException); + + private: + + //____________________________ + // @todo document me + void impl_update(const css::uno::Reference< css::frame::XFrame >& xFrame); + +}; // class TagWindowAsModified + +} // namespace framework + +#endif // #ifndef __FRAMEWORK_HELPER_TAGWINDOWASMODIFIED_HXX_ |