LibreOffice Module forms (master) 1
richtext/featuredispatcher.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/frame/XDispatch.hpp>
23#include <com/sun/star/lang/DisposedException.hpp>
27
28class EditView;
29
30namespace frm
31{
32
33 typedef ::cppu::WeakImplHelper < css::frame::XDispatch
35
38 {
39 private:
40 css::util::URL m_aFeatureURL;
44
45 protected:
47 const EditView* getEditView() const { return m_pEditView; }
48
49 protected:
50 const css::util::URL& getFeatureURL() const { return m_aFeatureURL; }
52 bool isDisposed() const { return m_bDisposed; }
53 void checkDisposed() const { if ( isDisposed() ) throw css::lang::DisposedException(); }
54
55 protected:
56 ORichTextFeatureDispatcher( EditView& _rView, css::util::URL _aURL );
57 virtual ~ORichTextFeatureDispatcher( ) override;
58
59 public:
61 void dispose();
62
63 // invalidate the feature, re-retrieve it's state, and broadcast changes, if necessary
64 void invalidate();
65
66 protected:
67 // overridables
68 virtual void disposing( ::osl::ClearableMutexGuard& _rClearBeforeNotify );
70
71 // to be overridden, and filled with the info special do your derived class
72 virtual css::frame::FeatureStateEvent
73 buildStatusEvent() const;
74
75 static void doNotify(
76 const css::uno::Reference< css::frame::XStatusListener >& _rxListener,
77 const css::frame::FeatureStateEvent& _rEvent
78 );
79
80 // XDispatch
81 virtual void SAL_CALL addStatusListener( const css::uno::Reference< css::frame::XStatusListener >& _rxControl, const css::util::URL& _rURL ) override;
82 virtual void SAL_CALL removeStatusListener( const css::uno::Reference< css::frame::XStatusListener >& _rxControl, const css::util::URL& _rURL ) override;
83 };
84
85
86} // namespace frm
87
88
89/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
const css::util::URL & getFeatureURL() const
virtual void SAL_CALL addStatusListener(const css::uno::Reference< css::frame::XStatusListener > &_rxControl, const css::util::URL &_rURL) override
::comphelper::OInterfaceContainerHelper3< css::frame::XStatusListener > m_aStatusListeners
void dispose()
clean up resources associated with this instance
static void doNotify(const css::uno::Reference< css::frame::XStatusListener > &_rxListener, const css::frame::FeatureStateEvent &_rEvent)
virtual void SAL_CALL removeStatusListener(const css::uno::Reference< css::frame::XStatusListener > &_rxControl, const css::util::URL &_rURL) override
ORichTextFeatureDispatcher(EditView &_rView, css::util::URL _aURL)
virtual css::frame::FeatureStateEvent buildStatusEvent() const
::comphelper::OInterfaceContainerHelper3< css::frame::XStatusListener > & getStatusListeners()
virtual void disposing(::osl::ClearableMutexGuard &_rClearBeforeNotify)
virtual ~ORichTextFeatureDispatcher() override
ListBox is a bit confusing / different from other form components, so here are a few notes:
Definition: BaseListBox.hxx:25
::cppu::WeakImplHelper< css::frame::XDispatch > ORichTextFeatureDispatcher_Base