/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* * This file is part of the LibreOffice project. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. * * This file incorporates work covered by the following license notice: * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed * with this work for additional information regarding copyright * ownership. The ASF licenses this file to you under the Apache * License, Version 2.0 (the "License"); you may not use this file * except in compliance with the License. You may obtain a copy of * the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
namespace com::sun::star { namespace awt { class XWindow; } namespace beans { struct PropertyValue; } namespace frame { class XDispatchProvider; } namespace frame { class XFrame; } namespace frame { class XFrameActionListener; } namespace frame { class XModel; } namespace frame { class XStatusListener; } namespace sdb { class XDatabaseContext; } namespace sdbc { class XConnection; } namespace sdbc { class XDataSource; } namespace uno { class XComponentContext; } namespace util { class XURLTransformer; }
}
namespace vcl { class Window; } namespace weld { class Window; } namespace framework { class TitleHelper; }
namespace dbaui
{ class ODataView;
template< typename T > inlinebool SAL_CALL operator >>= (const css::uno::Any& _any, std::optional< T >& _value)
{
_value.reset(); // de-init the optional value
T directValue = T(); if ( _any >>= directValue )
_value = directValue;
return !!_value;
}
// = FeatureState
/** describes the state of a feature
In opposite to the FeatureStateEvent in css.frame, this one allows for multiple states to be specified at once. With this, you can for instance specify that a toolbox item is checked, and has a certain title, at the same time.
*/ struct FeatureState
{ bool bEnabled;
std::mutex m_aFeatureMutex; // locked when features are append to or remove from deque
std::map<sal_uInt16, FeatureState> m_aStateCache; // save the current status of feature state
std::vector<DispatchTarget> m_arrStatusListener; // all our listeners where we dispatch status changes
OAsynchronousLink m_aAsyncInvalidateAll;
OAsynchronousLink m_aAsyncCloseTask; // called when a task should be closed
// closes the task when possible void closeTask();
// if getMenu returns a non empty string than this will be dispatched at the frame virtualvoid loadMenu(const css::uno::Reference< css::frame::XFrame >& _xFrame);
/** called when our menu has been loaded into our frame, can be used to load sub toolbars
// all the features which should be handled by this class virtualvoid describeSupportedFeatures();
// state of a feature. 'feature' may be the handle of a css::util::URL somebody requested a dispatch interface for OR a toolbar slot. virtual FeatureState GetState(sal_uInt16 nId) const; // execute a feature virtualvoid Execute(sal_uInt16 nId , const css::uno::Sequence< css::beans::PropertyValue>& aArgs);
/** describes a feature supported by the controller
Must not be called outside <member>describeSupportedFeatures</member>.
@param _rCommandURL the URL of the feature command @param _nFeatureId the id of the feature. Later references to this feature usually happen by id, not by URL @param _nCommandGroup the command group of the feature. This is important for configuring the controller UI by the user, see also <type scope="css::frame">CommandGroup</type>.
*/ void implDescribeSupportedFeature( const OUString& _rCommandURL,
sal_uInt16 _nFeatureId,
sal_Int16 _nCommandGroup = css::frame::CommandGroup::INTERNAL
);
/** returns <TRUE/> if the feature is supported, otherwise <FALSE/> @param _nId The ID of the feature.
*/ bool isFeatureSupported( sal_Int32 _nId );
// gets the URL which the given id is assigned to
css::util::URL getURLForId(sal_Int32 _nId) const;
/** determines whether the given feature ID denotes a user-defined feature
/** return the container window of the top most frame @return The top most container window, nmay be <NULL/>.
*/
css::uno::Reference< css::awt::XWindow> getTopMostContainerWindow() const;
// XInitialize will be called inside initialize virtualvoid impl_initialize(const ::comphelper::NamedValueCollection& rArguments);
// if there is a css::util::URL translation for the id // ('handle') then if xListener is NULL the change will be forwarded // to all listeners to the given css::util::URL // if there is a toolbar slot with the given id it is updated (the new state is determined via GetState) // if _bForceBroadcast is sal_True, the current feature state is broadcasted no matter if it is the same as the cached state void InvalidateFeature(sal_uInt16 nId, const css::uno::Reference< css::frame::XStatusListener > & xListener = nullptr, bool _bForceBroadcast = false);
/** InvalidateAll invalidates all features currently known
*/ void InvalidateAll(); // late construction virtualbool Construct(vcl::Window* pParent);
/** get the layout manager @param _xFrame The frame to ask for the layout manager. @return The layout manager of the frame, can be <NULL/> if the frame isn't initialized.
*/ static css::uno::Reference< css::frame::XLayoutManager > getLayoutManager(const css::uno::Reference< css::frame::XFrame >& _xFrame);
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.