From ed5640d8b587fbcfed7dd7967f3de04b37a76f26 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 11:06:44 +0200 Subject: Adding upstream version 4:7.4.7. Signed-off-by: Daniel Baumann --- framework/inc/classes/actiontriggercontainer.hxx | 64 +++++++++ framework/inc/classes/actiontriggerpropertyset.hxx | 113 ++++++++++++++++ .../classes/actiontriggerseparatorpropertyset.hxx | 96 ++++++++++++++ framework/inc/classes/converter.hxx | 45 +++++++ framework/inc/classes/fwkresid.hxx | 27 ++++ framework/inc/classes/protocolhandlercache.hxx | 146 +++++++++++++++++++++ framework/inc/classes/resource.hxx | 30 +++++ .../inc/classes/rootactiontriggercontainer.hxx | 101 ++++++++++++++ framework/inc/classes/taskcreator.hxx | 60 +++++++++ 9 files changed, 682 insertions(+) create mode 100644 framework/inc/classes/actiontriggercontainer.hxx create mode 100644 framework/inc/classes/actiontriggerpropertyset.hxx create mode 100644 framework/inc/classes/actiontriggerseparatorpropertyset.hxx create mode 100644 framework/inc/classes/converter.hxx create mode 100644 framework/inc/classes/fwkresid.hxx create mode 100644 framework/inc/classes/protocolhandlercache.hxx create mode 100644 framework/inc/classes/resource.hxx create mode 100644 framework/inc/classes/rootactiontriggercontainer.hxx create mode 100644 framework/inc/classes/taskcreator.hxx (limited to 'framework/inc/classes') diff --git a/framework/inc/classes/actiontriggercontainer.hxx b/framework/inc/classes/actiontriggercontainer.hxx new file mode 100644 index 000000000..71d4100d9 --- /dev/null +++ b/framework/inc/classes/actiontriggercontainer.hxx @@ -0,0 +1,64 @@ +/* -*- 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 . + */ + +#pragma once + +#include +#include +#include +#include + +inline constexpr OUStringLiteral SERVICENAME_ACTIONTRIGGERCONTAINER = u"com.sun.star.ui.ActionTriggerContainer"; +inline constexpr OUStringLiteral IMPLEMENTATIONNAME_ACTIONTRIGGERCONTAINER = u"com.sun.star.comp.ui.ActionTriggerContainer"; + +namespace framework +{ + +class ActionTriggerContainer final : public PropertySetContainer, + public css::lang::XMultiServiceFactory, + public css::lang::XServiceInfo, + public css::lang::XTypeProvider +{ + public: + ActionTriggerContainer(); + virtual ~ActionTriggerContainer() override; + + // XInterface + virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type& aType ) override; + virtual void SAL_CALL acquire() noexcept override; + virtual void SAL_CALL release() noexcept override; + + // XMultiServiceFactory + virtual css::uno::Reference< css::uno::XInterface > SAL_CALL createInstance( const OUString& aServiceSpecifier ) override; + virtual css::uno::Reference< css::uno::XInterface > SAL_CALL createInstanceWithArguments( const OUString& ServiceSpecifier, const css::uno::Sequence< css::uno::Any >& Arguments ) override; + virtual css::uno::Sequence< OUString > SAL_CALL getAvailableServiceNames() override; + + // XServiceInfo + virtual OUString SAL_CALL getImplementationName( ) override; + virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override; + virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames( ) override; + + // XTypeProvider + virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes( ) override; + virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId( ) override; +}; + +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/framework/inc/classes/actiontriggerpropertyset.hxx b/framework/inc/classes/actiontriggerpropertyset.hxx new file mode 100644 index 000000000..78d49e7ef --- /dev/null +++ b/framework/inc/classes/actiontriggerpropertyset.hxx @@ -0,0 +1,113 @@ +/* -*- 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 . + */ + +#pragma once + +#include +#include +#include +#include + +#include +#include +#include + +inline constexpr OUStringLiteral SERVICENAME_ACTIONTRIGGER = u"com.sun.star.ui.ActionTrigger"; +inline constexpr OUStringLiteral IMPLEMENTATIONNAME_ACTIONTRIGGER = u"com.sun.star.comp.ui.ActionTrigger"; + +namespace framework +{ + +class ActionTriggerPropertySet final : private cppu::BaseMutex, + public css::lang::XServiceInfo , + public css::lang::XTypeProvider, + public ::cppu::OBroadcastHelper , + public ::cppu::OPropertySetHelper , // -> XPropertySet, XFastPropertySet, XMultiPropertySet + public ::cppu::OWeakObject +{ + public: + ActionTriggerPropertySet(); + virtual ~ActionTriggerPropertySet() override; + + // XInterface + virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type& aType ) override; + virtual void SAL_CALL acquire() noexcept override; + virtual void SAL_CALL release() noexcept override; + + // XServiceInfo + virtual OUString SAL_CALL getImplementationName( ) override; + virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override; + virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames( ) override; + + // XTypeProvider + virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes( ) override; + virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId( ) override; + + private: + + // OPropertySetHelper + + virtual sal_Bool SAL_CALL convertFastPropertyValue( css::uno::Any& aConvertedValue, + css::uno::Any& aOldValue, + sal_Int32 nHandle, + const css::uno::Any& aValue ) override; + + virtual void SAL_CALL setFastPropertyValue_NoBroadcast( sal_Int32 nHandle, const css::uno::Any& aValue ) override; + + using cppu::OPropertySetHelper::getFastPropertyValue; + virtual void SAL_CALL getFastPropertyValue( css::uno::Any& aValue, sal_Int32 nHandle ) const override; + + virtual ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper() override; + + virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() override; + + static css::uno::Sequence< css::beans::Property > impl_getStaticPropertyDescriptor(); + + // helper + + /// @throws css::lang::IllegalArgumentException + bool impl_tryToChangeProperty( const OUString& aCurrentValue , + const css::uno::Any& aNewValue , + css::uno::Any& aOldValue , + css::uno::Any& aConvertedValue ); + + /// @throws css::lang::IllegalArgumentException + bool impl_tryToChangeProperty( const css::uno::Reference< css::awt::XBitmap >& xBitmap, + const css::uno::Any& aNewValue , + css::uno::Any& aOldValue , + css::uno::Any& aConvertedValue ); + + /// @throws css::lang::IllegalArgumentException + bool impl_tryToChangeProperty( const css::uno::Reference< css::uno::XInterface >& xInterface, + const css::uno::Any& aNewValue , + css::uno::Any& aOldValue , + css::uno::Any& aConvertedValue ); + + // members + + OUString m_aCommandURL; + OUString m_aHelpURL; + OUString m_aText; + css::uno::Reference< css::awt::XBitmap > m_xBitmap; + css::uno::Reference< css::uno::XInterface > m_xActionTriggerContainer; +}; + +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/framework/inc/classes/actiontriggerseparatorpropertyset.hxx b/framework/inc/classes/actiontriggerseparatorpropertyset.hxx new file mode 100644 index 000000000..b68493696 --- /dev/null +++ b/framework/inc/classes/actiontriggerseparatorpropertyset.hxx @@ -0,0 +1,96 @@ +/* -*- 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 . + */ + +#pragma once + +#include +#include +#include +#include +#include +#include + +inline constexpr OUStringLiteral SERVICENAME_ACTIONTRIGGERSEPARATOR = u"com.sun.star.ui.ActionTriggerSeparator"; +inline constexpr OUStringLiteral IMPLEMENTATIONNAME_ACTIONTRIGGERSEPARATOR = u"com.sun.star.comp.ui.ActionTriggerSeparator"; + +namespace framework +{ + +class ActionTriggerSeparatorPropertySet final : private cppu::BaseMutex, + public css::lang::XServiceInfo , + public css::lang::XTypeProvider, + public ::cppu::OBroadcastHelper , + public ::cppu::OPropertySetHelper , // -> XPropertySet, XFastPropertySet, XMultiPropertySet + public ::cppu::OWeakObject +{ + public: + ActionTriggerSeparatorPropertySet(); + virtual ~ActionTriggerSeparatorPropertySet() override; + + // XInterface + virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type& aType ) override; + virtual void SAL_CALL acquire() noexcept override; + virtual void SAL_CALL release() noexcept override; + + // XServiceInfo + virtual OUString SAL_CALL getImplementationName( ) override; + virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override; + virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames( ) override; + + // XTypeProvider + virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes( ) override; + virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId( ) override; + + private: + + // OPropertySetHelper + + virtual sal_Bool SAL_CALL convertFastPropertyValue( css::uno::Any& aConvertedValue, + css::uno::Any& aOldValue, + sal_Int32 nHandle, + const css::uno::Any& aValue ) override; + + virtual void SAL_CALL setFastPropertyValue_NoBroadcast( sal_Int32 nHandle, const css::uno::Any& aValue ) override; + + using cppu::OPropertySetHelper::getFastPropertyValue; + virtual void SAL_CALL getFastPropertyValue( css::uno::Any& aValue, sal_Int32 nHandle ) const override; + + virtual ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper() override; + + virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() override; + + static css::uno::Sequence< css::beans::Property > impl_getStaticPropertyDescriptor(); + + // helper + + /// @throws css::lang::IllegalArgumentException + /// @throws css::uno::RuntimeException + bool impl_tryToChangeProperty( sal_Int16 aCurrentValue , + const css::uno::Any& aNewValue , + css::uno::Any& aOldValue , + css::uno::Any& aConvertedValue ); + + // members + + sal_Int16 m_nSeparatorType; +}; + +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/framework/inc/classes/converter.hxx b/framework/inc/classes/converter.hxx new file mode 100644 index 000000000..17198ec2c --- /dev/null +++ b/framework/inc/classes/converter.hxx @@ -0,0 +1,45 @@ +/* -*- 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 . + */ + +#pragma once + +#include + +#include +#include +#include +#include + +namespace framework{ + +class Converter +{ + public: + // Seq <=> Seq + static css::uno::Sequence< css::beans::NamedValue > convert_seqPropVal2seqNamedVal ( const css::uno::Sequence< css::beans::PropertyValue >& lSource ); + + // Seq => Vector + static std::vector convert_seqOUString2OUStringList( const css::uno::Sequence< OUString >& lSource ); + + static OUString convert_DateTime2ISO8601 ( const DateTime& aSource ); +}; + +} // namespace framework + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/framework/inc/classes/fwkresid.hxx b/framework/inc/classes/fwkresid.hxx new file mode 100644 index 000000000..5023f34a2 --- /dev/null +++ b/framework/inc/classes/fwkresid.hxx @@ -0,0 +1,27 @@ +/* -*- 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 . + */ + +#pragma once + +#include +#include + +OUString FwkResId(TranslateId aId); + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/framework/inc/classes/protocolhandlercache.hxx b/framework/inc/classes/protocolhandlercache.hxx new file mode 100644 index 000000000..e156f9b0d --- /dev/null +++ b/framework/inc/classes/protocolhandlercache.hxx @@ -0,0 +1,146 @@ +/* -*- 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 . + */ + +#pragma once + +#include +#include + +#include + +#include +#include + +namespace framework{ + +inline constexpr OUStringLiteral PACKAGENAME_PROTOCOLHANDLER = u"Office.ProtocolHandler"; /// name of our configuration package + +#define CFG_PATH_SEPARATOR "/" /// separator for configuration paths + +#define PROPERTY_PROTOCOLS "Protocols" /// properties of a protocol handler + +/** + Programmer can register his own services to handle different protocols. + Don't forget: It doesn't mean "handling of documents" ... these services could handle protocols ... + e.g. "mailto:", "file://", ".java:" + This struct holds the information about one such registered protocol handler. + A list of handler objects is defined as ProtocolHandlerHash. see below +*/ +struct ProtocolHandler +{ + /* member */ + public: + + /// the uno implementation name of this handler + OUString m_sUNOName; + /// list of URL pattern which defines the protocols which this handler is registered for + std::vector m_lProtocols; +}; + +/** + This hash use registered pattern of all protocol handlers as keys and provide her + uno implementation names as value. Overloading of the index operator makes it possible + to search for a key by using a full qualified URL on list of all possible pattern keys. +*/ +typedef std::unordered_map PatternHash; + +/** + This hash holds protocol handler structs by her names. +*/ +typedef std::unordered_map HandlerHash; + +/** + @short this hash makes it easy to find a protocol handler by using his uno implementation name. + @descr It holds two lists of information: + - first holds all handler by her uno implementation names and + can be used to get her other properties + - another one maps her registered pattern to her uno names to + perform search on such data + But this lists a static for all instances of this class. So it's possible to + create new objects without opening configuration twice and free memory automatically + if last object will gone. + + @attention We implement a singleton concept - so we don't need any mutex member here. + Because to safe access on static member we must use a static global lock + here too. + + @devstatus ready to use + @threadsafe yes +*/ + +class HandlerCFGAccess; +class HandlerCache final +{ + /* member */ + private: + + /// list of all registered handler registered by her uno implementation names + static std::optional s_pHandler; + /// maps URL pattern to handler names + static std::optional s_pPattern; + /// informs about config updates + static HandlerCFGAccess* s_pConfig; + /// ref count to construct/destruct internal member lists on demand by using singleton mechanism + static sal_Int32 m_nRefCount; + + /* interface */ + public: + + HandlerCache(); + ~HandlerCache(); + + bool search( const OUString& sURL, ProtocolHandler* pReturn ) const; + bool search( const css::util::URL& aURL, ProtocolHandler* pReturn ) const; + + void takeOver(HandlerHash aHandler, PatternHash aPattern); +}; + +/** + @short implements configuration access for handler configuration + @descr We use the ConfigItem mechanism to read/write values from/to configuration. + We set a data container pointer for filling or reading ... this class use it temp. + After successfully calling of read(), we can use filled container directly or merge it with an existing one. + After successfully calling of write() all values of given data container are flushed to our configuration - + but current implementation doesn't support writing really. + + @base ::utl::ConfigItem + base mechanism for configuration access + + @devstatus ready to use + @threadsafe no +*/ +class HandlerCFGAccess final : public ::utl::ConfigItem +{ + private: + HandlerCache* m_pCache; + + virtual void ImplCommit() override; + + /* interface */ + public: + HandlerCFGAccess( const OUString& sPackage ); + void read ( HandlerHash& rHandlerHash, PatternHash& rPatternHash ); + + void setCache(HandlerCache* pCache) {m_pCache = pCache;}; + virtual void Notify(const css::uno::Sequence< OUString >& lPropertyNames) override; +}; + +} // namespace framework + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/framework/inc/classes/resource.hxx b/framework/inc/classes/resource.hxx new file mode 100644 index 000000000..64d89d119 --- /dev/null +++ b/framework/inc/classes/resource.hxx @@ -0,0 +1,30 @@ +/* -*- 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 . + */ + +#pragma once + +#define MENUITEM_TOOLBAR_VISIBLEBUTTON 1 +#define MENUITEM_TOOLBAR_CUSTOMIZETOOLBAR 2 +#define MENUITEM_TOOLBAR_UNDOCKTOOLBAR 3 +#define MENUITEM_TOOLBAR_DOCKTOOLBAR 4 +#define MENUITEM_TOOLBAR_DOCKALLTOOLBAR 5 +#define MENUITEM_TOOLBAR_LOCKTOOLBARPOSITION 6 +#define MENUITEM_TOOLBAR_CLOSE 7 + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/framework/inc/classes/rootactiontriggercontainer.hxx b/framework/inc/classes/rootactiontriggercontainer.hxx new file mode 100644 index 000000000..4fd5f24f9 --- /dev/null +++ b/framework/inc/classes/rootactiontriggercontainer.hxx @@ -0,0 +1,101 @@ +/* -*- 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 . + */ + +#pragma once + +#include +#include +#include +#include +#include +#include +#include + +inline constexpr OUStringLiteral IMPLEMENTATIONNAME_ROOTACTIONTRIGGERCONTAINER = u"com.sun.star.comp.ui.RootActionTriggerContainer"; + +namespace framework +{ + +class RootActionTriggerContainer final : public PropertySetContainer, + public css::lang::XMultiServiceFactory, + public css::lang::XServiceInfo, + public css::lang::XUnoTunnel, + public css::lang::XTypeProvider, + public css::container::XNamed +{ + public: + RootActionTriggerContainer(css::uno::Reference xMenu, const OUString* pMenuIdentifier); + virtual ~RootActionTriggerContainer() override; + + // XInterface + virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type& aType ) override; + virtual void SAL_CALL acquire() noexcept override; + virtual void SAL_CALL release() noexcept override; + + // XMultiServiceFactory + virtual css::uno::Reference< css::uno::XInterface > SAL_CALL createInstance( const OUString& aServiceSpecifier ) override; + virtual css::uno::Reference< css::uno::XInterface > SAL_CALL createInstanceWithArguments( const OUString& ServiceSpecifier, const css::uno::Sequence< css::uno::Any >& Arguments ) override; + virtual css::uno::Sequence< OUString > SAL_CALL getAvailableServiceNames() override; + + // XIndexContainer + virtual void SAL_CALL insertByIndex( sal_Int32 Index, const css::uno::Any& Element ) override; + + virtual void SAL_CALL removeByIndex( sal_Int32 Index ) override; + + // XIndexReplace + virtual void SAL_CALL replaceByIndex( sal_Int32 Index, const css::uno::Any& Element ) override; + + // XIndexAccess + virtual sal_Int32 SAL_CALL getCount() override; + + virtual css::uno::Any SAL_CALL getByIndex( sal_Int32 Index ) override; + + // XElementAccess + virtual css::uno::Type SAL_CALL getElementType() override; + + virtual sal_Bool SAL_CALL hasElements() override; + + // XServiceInfo + virtual OUString SAL_CALL getImplementationName( ) override; + virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override; + virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames( ) override; + + // XUnoTunnel + virtual sal_Int64 SAL_CALL getSomething( const css::uno::Sequence< sal_Int8 >& aIdentifier ) override; + static const css::uno::Sequence& getUnoTunnelId() noexcept; + + // XTypeProvider + virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes( ) override; + virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId( ) override; + + // XNamed + virtual OUString SAL_CALL getName( ) override; + virtual void SAL_CALL setName( const OUString& aName ) override; + + private: + void FillContainer(); + + bool m_bContainerCreated; + css::uno::Reference m_xMenu; + const OUString* m_pMenuIdentifier; +}; + +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/framework/inc/classes/taskcreator.hxx b/framework/inc/classes/taskcreator.hxx new file mode 100644 index 000000000..d57cc406e --- /dev/null +++ b/framework/inc/classes/taskcreator.hxx @@ -0,0 +1,60 @@ +/* -*- 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 . + */ + +#pragma once + +#include +#include + +#include +#include +#include + +namespace framework{ + +/* + @short a helper to create new tasks or sub frames for "_blank" or FrameSearchFlag::CREATE + @descr There are different places to create new (task)frames and it's not easy to service this code. + That's the reason for this helper. It encapsulates asynchronous/synchronous creation + by providing a simple interface. + + @devstatus ready to use + @threadsafe yes +*/ +class TaskCreator final +{ + + // member + private: + + css::uno::Reference< css::uno::XComponentContext > m_xContext; + + // interface + public: + + TaskCreator( css::uno::Reference< css::uno::XComponentContext > xContext ); + ~TaskCreator( ); + + css::uno::Reference< css::frame::XFrame > createTask( const OUString& sName, const utl::MediaDescriptor& rDescriptor ); + +}; // class TaskCreator + +} // namespace framework + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ -- cgit v1.2.3