Version 7.6.3.2-android, tag libreoffice-7.6.3.2-android
[LibreOffice.git] / framework / inc / helper / tagwindowasmodified.hxx
blobe8c9fff22da9d923aa147ee5af015c4aaee5d0e5
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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 #pragma once
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>
31 namespace framework{
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
36 title bar.
38 @base OWeakObject
39 implements ref counting for this class.
41 @devstatus draft
42 @threadsafe yes
43 *//*-*************************************************************************************************************/
44 class TagWindowAsModified final : public ::cppu::WeakImplHelper<
45 css::lang::XInitialization,
46 css::frame::XFrameActionListener, // => XEventListener
47 css::util::XModifyListener > // => XEventListener
50 // member
52 private:
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;
63 // interface
65 public:
67 // ctor/dtor
68 TagWindowAsModified();
69 virtual ~TagWindowAsModified( ) override;
71 // XInterface, XTypeProvider
73 // XInitialization
74 virtual void SAL_CALL initialize(const css::uno::Sequence< css::uno::Any >& lArguments) override;
76 // XModifyListener
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;
82 // XEventListener
83 virtual void SAL_CALL disposing(const css::lang::EventObject& aEvent) override;
85 private:
87 // @todo document me
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: */