LibreOffice Module framework (master) 1
tagwindowasmodified.hxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
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/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
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 .
18 */
19
20#pragma once
21
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>
27
29#include <vcl/window.hxx>
30
31namespace framework{
32
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.
37
38 @base OWeakObject
39 implements ref counting for this class.
40
41 @devstatus draft
42 @threadsafe yes
43*//*-*************************************************************************************************************/
44class TagWindowAsModified final : public ::cppu::WeakImplHelper<
45 css::lang::XInitialization,
46 css::frame::XFrameActionListener, // => XEventListener
47 css::util::XModifyListener > // => XEventListener
48{
49
50 // member
51
52 private:
53
55 css::uno::Reference< css::frame::XFrame > m_xFrame;
56
59
61 css::uno::Reference< css::util::XModifiable > m_xModel;
62
63 // interface
64
65 public:
66
67 // ctor/dtor
69 virtual ~TagWindowAsModified( ) override;
70
71 // XInterface, XTypeProvider
72
73 // XInitialization
74 virtual void SAL_CALL initialize(const css::uno::Sequence< css::uno::Any >& lArguments) override;
75
76 // XModifyListener
77 virtual void SAL_CALL modified(const css::lang::EventObject& aEvent) override;
78
79 // XFrameActionListener
80 virtual void SAL_CALL frameAction(const css::frame::FrameActionEvent& aEvent) override;
81
82 // XEventListener
83 virtual void SAL_CALL disposing(const css::lang::EventObject& aEvent) override;
84
85 private:
86
87 // @todo document me
88 void impl_update(const css::uno::Reference< css::frame::XFrame >& xFrame);
89
90}; // class TagWindowAsModified
91
92} // namespace framework
93
94/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual void SAL_CALL frameAction(const css::frame::FrameActionEvent &aEvent) override
virtual void SAL_CALL disposing(const css::lang::EventObject &aEvent) override
css::uno::Reference< css::util::XModifiable > m_xModel
we list on the model for modify events
void impl_update(const css::uno::Reference< css::frame::XFrame > &xFrame)
virtual void SAL_CALL modified(const css::lang::EventObject &aEvent) override
virtual void SAL_CALL initialize(const css::uno::Sequence< css::uno::Any > &lArguments) override
css::uno::Reference< css::frame::XFrame > m_xFrame
reference to the frame, where we listen for new loaded documents for updating our own xModel referenc...
VclPtr< vcl::Window > m_xWindow
reference to the frame container window, where we must set the tag