LibreOffice Module extensions (master) 1
composeduiupdate.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/inspection/XObjectInspectorUI.hpp>
23#include <com/sun/star/inspection/XPropertyHandler.hpp>
24
25#include <memory>
26
27
28namespace pcr
29{
30
31 struct MapHandlerToUI;
32
36 {
37 public:
39 virtual bool hasPropertyByName( const OUString& _rName ) = 0;
40
41 protected:
43 };
44
59 {
60 private:
61 std::unique_ptr< MapHandlerToUI > m_pCollectedUIs;
62 css::uno::Reference< css::inspection::XObjectInspectorUI >
64 oslInterlockedCount m_nSuspendCounter;
66
67 public:
82 const css::uno::Reference< css::inspection::XObjectInspectorUI >& _rxDelegatorUI,
83 IPropertyExistenceCheck* _pPropertyCheck );
85
89 css::uno::Reference< css::inspection::XObjectInspectorUI > const & getDelegatorUI() const;
90
98 css::uno::Reference< css::inspection::XObjectInspectorUI >
99 getUIForPropertyHandler( const css::uno::Reference< css::inspection::XPropertyHandler >& _rxHandler );
100
117 void suspendAutoFire();
118
123 void resumeAutoFire();
124
131 void dispose();
132
135 bool shouldContinuePropertyHandling( const OUString& _rName ) const;
136
137 private:
139 bool impl_isDisposed() const { return !m_pCollectedUIs; }
140
142 void impl_checkDisposed() const;
143
162 void impl_fireAll_throw();
163
166
169
172
175
178
182
183 private:
186 };
187
189 {
190 private:
192 public:
194 :m_rUIUpdate( _rUIUpdate )
195 {
197 }
198 ~ComposedUIAutoFireGuard() COVERITY_NOEXCEPT_FALSE
199 {
201 }
202 };
203
204
205} // namespace pcr
206
207
208/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
helper class composing requests to a ->XObjectInspectorUI interface, coming from multiple sources
void resumeAutoFire()
Suspends automatic firing of UI changes.
bool shouldContinuePropertyHandling(const OUString &_rName) const
invokes m_pPropertyCheck to check whether a given property should be handled
css::uno::Reference< css::inspection::XObjectInspectorUI > m_xDelegatorUI
void impl_checkDisposed() const
throws an exception if the component is already disposed
bool impl_isDisposed() const
determines whether the instance is already disposed
std::unique_ptr< MapHandlerToUI > m_pCollectedUIs
ComposedPropertyUIUpdate(const css::uno::Reference< css::inspection::XObjectInspectorUI > &_rxDelegatorUI, IPropertyExistenceCheck *_pPropertyCheck)
constructs a ->ComposedPropertyUIUpdate instance
void impl_fireShowCategory_throw()
fires the combination of ->XObjectInspectorUI::showCategory calls
void dispose()
disposes the instance, so it becomes non-functional.
void impl_fireEnablePropertyUIElements_throw()
fires the combination of ->XObjectInspectorUI::enablePropertyUIElements calls
void impl_fireRebuildPropertyUI_throw()
fires the combination of ->XObjectInspectorUI::rebuildPropertyUI calls
ComposedPropertyUIUpdate & operator=(const ComposedPropertyUIUpdate &)=delete
ComposedPropertyUIUpdate(const ComposedPropertyUIUpdate &)=delete
oslInterlockedCount m_nSuspendCounter
void suspendAutoFire()
Suspends automatic firing of UI changes.
void callback_inspectorUIChanged_throw()
callback for when a single property handler requested any change in the inspector UI
IPropertyExistenceCheck * m_pPropertyCheck
css::uno::Reference< css::inspection::XObjectInspectorUI > getUIForPropertyHandler(const css::uno::Reference< css::inspection::XPropertyHandler > &_rxHandler)
returns a ->XObjectInspectorUI instance belonging to a given property handler
css::uno::Reference< css::inspection::XObjectInspectorUI > const & getDelegatorUI() const
returns the delegator UI
void impl_fireEnablePropertyUI_throw()
fires the combination of ->XObjectInspectorUI::enablePropertyUI calls
void impl_fireShowHidePropertyUI_throw()
fires the combination of ->XObjectInspectorUI::showPropertyUI and ->XObjectInspectorUI::hidePropertyU...
void impl_fireAll_throw()
fires the collected UI changes to our delegator UI
~ComposedUIAutoFireGuard() COVERITY_NOEXCEPT_FALSE
ComposedUIAutoFireGuard(ComposedPropertyUIUpdate &_rUIUpdate)
ComposedPropertyUIUpdate & m_rUIUpdate
callback for a ComposedPropertyUIUpdate checking a given property for existence
virtual bool hasPropertyByName(const OUString &_rName)=0
a property handler for any virtual string properties
Definition: browserline.cxx:39
#define SAL_NO_VTABLE