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 .
22 #include <com/sun/star/lang/XInitialization.hpp>
23 #include <com/sun/star/frame/XFrame.hpp>
24 #include <com/sun/star/util/XModifyListener.hpp>
25 #include <com/sun/star/frame/XFrameActionListener.hpp>
26 #include <com/sun/star/util/XModifiable.hpp>
28 #include <cppuhelper/implbase.hxx>
29 #include <vcl/window.hxx>
33 /*-************************************************************************************************************
34 @short listen for modify events on model and tag frame container window so it can react accordingly
35 @descr Used e.g. by our MAC port where such state is shown separately on some controls of the
39 implements ref counting for this class.
43 *//*-*************************************************************************************************************/
44 class TagWindowAsModified final
: public ::cppu::WeakImplHelper
<
45 css::lang::XInitialization
,
46 css::frame::XFrameActionListener
, // => XEventListener
47 css::util::XModifyListener
> // => XEventListener
54 /// reference to the frame, where we listen for new loaded documents for updating our own xModel reference
55 css::uno::Reference
< css::frame::XFrame
> m_xFrame
;
57 /// reference to the frame container window, where we must set the tag
58 VclPtr
<vcl::Window
> m_xWindow
;
60 /// we list on the model for modify events
61 css::uno::Reference
< css::util::XModifiable
> m_xModel
;
68 TagWindowAsModified();
69 virtual ~TagWindowAsModified( ) override
;
71 // XInterface, XTypeProvider
74 virtual void SAL_CALL
initialize(const css::uno::Sequence
< css::uno::Any
>& lArguments
) override
;
77 virtual void SAL_CALL
modified(const css::lang::EventObject
& aEvent
) override
;
79 // XFrameActionListener
80 virtual void SAL_CALL
frameAction(const css::frame::FrameActionEvent
& aEvent
) override
;
83 virtual void SAL_CALL
disposing(const css::lang::EventObject
& aEvent
) override
;
88 void impl_update(const css::uno::Reference
< css::frame::XFrame
>& xFrame
);
90 }; // class TagWindowAsModified
92 } // namespace framework
94 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */