LibreOffice Module ucbhelper (master) 1
contentinfo.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#ifndef UCBHELPER_SOURCE_PROVIDER_CONTENTINFO_HXX
21#define UCBHELPER_SOURCE_PROVIDER_CONTENTINFO_HXX
22
23#include <optional>
24#include <com/sun/star/ucb/XCommandInfo.hpp>
25#include <com/sun/star/beans/XPropertySetInfo.hpp>
27
28#include <mutex>
29
30namespace com::sun::star::ucb { class XCommandEnvironment; }
31
32namespace ucbhelper {
33
34
35
36
37class ContentImplHelper;
38
46 public cppu::WeakImplHelper<css::beans::XPropertySetInfo>
47{
48 css::uno::Reference< css::ucb::XCommandEnvironment >
50 std::optional<css::uno::Sequence< css::beans::Property >>
52 std::mutex m_aMutex;
54
55private:
56 bool queryProperty( std::u16string_view rName,
57 css::beans::Property& rProp );
58 const css::uno::Sequence< css::beans::Property > & getPropertiesImpl();
59
60public:
61 PropertySetInfo( css::uno::Reference< css::ucb::XCommandEnvironment > xEnv,
62 ContentImplHelper* pContent );
63 virtual ~PropertySetInfo() override;
64
65 // XPropertySetInfo
66 virtual css::uno::Sequence< css::beans::Property > SAL_CALL getProperties() override;
67 virtual css::beans::Property SAL_CALL getPropertyByName( const OUString& aName ) override;
68 virtual sal_Bool SAL_CALL hasPropertyByName( const OUString& Name ) override;
69
70 // Non-Interface methods.
71 void reset();
72};
73
74
75
76
83 public cppu::WeakImplHelper<css::ucb::XCommandInfo>
84{
85 css::uno::Reference< css::ucb::XCommandEnvironment >
87 std::optional<css::uno::Sequence< css::ucb::CommandInfo >>
89 std::mutex m_aMutex;
91
92private:
93 bool queryCommand( std::u16string_view rName,
94 css::ucb::CommandInfo& rCommand );
95 bool queryCommand( sal_Int32 nHandle,
96 css::ucb::CommandInfo& rCommand );
97 const css::uno::Sequence< css::ucb::CommandInfo > & getCommandsImpl();
98
99public:
100 CommandProcessorInfo( css::uno::Reference< css::ucb::XCommandEnvironment > xEnv,
101 ContentImplHelper* pContent );
102 virtual ~CommandProcessorInfo() override;
103
104 // XCommandInfo
105 virtual css::uno::Sequence< css::ucb::CommandInfo > SAL_CALL getCommands() override;
106 virtual css::ucb::CommandInfo SAL_CALL getCommandInfoByName( const OUString& Name ) override;
107 virtual css::ucb::CommandInfo SAL_CALL getCommandInfoByHandle( sal_Int32 Handle ) override;
108 virtual sal_Bool SAL_CALL hasCommandByName( const OUString& Name ) override;
109 virtual sal_Bool SAL_CALL hasCommandByHandle( sal_Int32 Handle ) override;
110
111 // Non-Interface methods.
112 void reset();
113};
114
115} // namespace ucbhelper
116
117#endif /* ! UCBHELPER_SOURCE_PROVIDER_CONTENTINFO_HXX */
118
119/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
This class provides a command info ( the complete implementation of the interface XCommandInfo ) for ...
Definition: contentinfo.hxx:84
std::optional< css::uno::Sequence< css::ucb::CommandInfo > > m_xCommands
Definition: contentinfo.hxx:88
virtual css::ucb::CommandInfo SAL_CALL getCommandInfoByName(const OUString &Name) override
virtual ~CommandProcessorInfo() override
virtual sal_Bool SAL_CALL hasCommandByHandle(sal_Int32 Handle) override
CommandProcessorInfo(css::uno::Reference< css::ucb::XCommandEnvironment > xEnv, ContentImplHelper *pContent)
virtual css::ucb::CommandInfo SAL_CALL getCommandInfoByHandle(sal_Int32 Handle) override
virtual css::uno::Sequence< css::ucb::CommandInfo > SAL_CALL getCommands() override
bool queryCommand(std::u16string_view rName, css::ucb::CommandInfo &rCommand)
virtual sal_Bool SAL_CALL hasCommandByName(const OUString &Name) override
css::uno::Reference< css::ucb::XCommandEnvironment > m_xEnv
Definition: contentinfo.hxx:86
ContentImplHelper * m_pContent
Definition: contentinfo.hxx:90
const css::uno::Sequence< css::ucb::CommandInfo > & getCommandsImpl()
This is an abstract base class for implementations of the service com.sun.star.ucb....
This class provides a propertyset info ( the complete implementation of the interface XPropertySetInf...
Definition: contentinfo.hxx:47
ContentImplHelper * m_pContent
Definition: contentinfo.hxx:53
css::uno::Reference< css::ucb::XCommandEnvironment > m_xEnv
Definition: contentinfo.hxx:49
bool queryProperty(std::u16string_view rName, css::beans::Property &rProp)
virtual css::beans::Property SAL_CALL getPropertyByName(const OUString &aName) override
const css::uno::Sequence< css::beans::Property > & getPropertiesImpl()
Definition: contentinfo.cxx:62
virtual sal_Bool SAL_CALL hasPropertyByName(const OUString &Name) override
virtual ~PropertySetInfo() override
Definition: contentinfo.cxx:47
PropertySetInfo(css::uno::Reference< css::ucb::XCommandEnvironment > xEnv, ContentImplHelper *pContent)
std::optional< css::uno::Sequence< css::beans::Property > > m_xProps
Definition: contentinfo.hxx:51
virtual css::uno::Sequence< css::beans::Property > SAL_CALL getProperties() override
Definition: contentinfo.cxx:56
sal_Int32 nHandle
Definition: resultset.cxx:44
unsigned char sal_Bool