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_TAGWINDOWASMODIFIED_HXX
21 #define INCLUDED_FRAMEWORK_INC_HELPER_TAGWINDOWASMODIFIED_HXX
23 #include <macros/xinterface.hxx>
24 #include <macros/xtypeprovider.hxx>
27 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
28 #include <com/sun/star/lang/XInitialization.hpp>
29 #include <com/sun/star/frame/XFrame.hpp>
30 #include <com/sun/star/util/XModifyListener.hpp>
31 #include <com/sun/star/lang/XEventListener.hpp>
32 #include <com/sun/star/frame/XFrameActionListener.hpp>
34 #include <cppuhelper/implbase3.hxx>
38 /*-************************************************************************************************************
39 @short listen for modify events on model and tag frame container window so it can react accordingly
40 @descr Used e.g. by our MAC port where such state is shown separately on some controls of the
44 implements ref counting for this class.
48 *//*-*************************************************************************************************************/
49 class TagWindowAsModified
: public ::cppu::WeakImplHelper3
<
50 css::lang::XInitialization
,
51 css::frame::XFrameActionListener
, // => XEventListener
52 css::util::XModifyListener
> // => XEventListener
59 /// reference to the frame, where we listen for new loaded documents for updating our own xModel reference
60 css::uno::WeakReference
< css::frame::XFrame
> m_xFrame
;
62 /// reference to the frame container window, where we must set the tag
63 css::uno::WeakReference
< css::awt::XWindow
> m_xWindow
;
65 /// we list on the model for modify events
66 css::uno::WeakReference
< css::frame::XModel
> m_xModel
;
73 TagWindowAsModified();
74 virtual ~TagWindowAsModified( );
76 // XInterface, XTypeProvider
79 virtual void SAL_CALL
initialize(const css::uno::Sequence
< css::uno::Any
>& lArguments
)
80 throw(css::uno::Exception
,
81 css::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
84 virtual void SAL_CALL
modified(const css::lang::EventObject
& aEvent
)
85 throw(css::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
87 // XFrameActionListener
88 virtual void SAL_CALL
frameAction(const css::frame::FrameActionEvent
& aEvent
)
89 throw(css::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
92 virtual void SAL_CALL
disposing(const css::lang::EventObject
& aEvent
)
93 throw(css::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
98 void impl_update(const css::uno::Reference
< css::frame::XFrame
>& xFrame
);
100 }; // class TagWindowAsModified
102 } // namespace framework
104 #endif // INCLUDED_FRAMEWORK_INC_HELPER_TAGWINDOWASMODIFIED_HXX
106 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */