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