build fix
[LibreOffice.git] / include / ucbhelper / contentinfo.hxx
blobee1f9ec4342026547f734b744a975ac3324357e2
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #ifndef INCLUDED_UCBHELPER_CONTENTINFO_HXX
21 #define INCLUDED_UCBHELPER_CONTENTINFO_HXX
23 #include <com/sun/star/ucb/XCommandInfo.hpp>
24 #include <com/sun/star/ucb/XCommandEnvironment.hpp>
25 #include <com/sun/star/lang/XTypeProvider.hpp>
26 #include <com/sun/star/beans/XPropertySetInfo.hpp>
27 #include <cppuhelper/weak.hxx>
29 #include <osl/mutex.hxx>
30 #include <ucbhelper/macros.hxx>
32 namespace ucbhelper {
35 // class PropertySetInfo.
38 class ContentImplHelper;
40 /**
41 * This class provides a propertyset info ( the complete implementation of
42 * the interface XPropertySetInfo ) for an object derived from class
43 * ucb::ContentImplHelper. The implementation takes care about Additional
44 * Core Properties that may have been added to the content.
46 class PropertySetInfo :
47 public cppu::OWeakObject,
48 public css::lang::XTypeProvider,
49 public css::beans::XPropertySetInfo
51 css::uno::Reference< css::ucb::XCommandEnvironment >
52 m_xEnv;
53 css::uno::Sequence< css::beans::Property >*
54 m_pProps;
55 osl::Mutex m_aMutex;
56 ContentImplHelper* m_pContent;
58 private:
59 bool queryProperty( const OUString& rName,
60 css::beans::Property& rProp );
62 public:
63 PropertySetInfo( const css::uno::Reference< css::ucb::XCommandEnvironment >& rxEnv,
64 ContentImplHelper* pContent );
65 virtual ~PropertySetInfo() override;
67 // XInterface
68 virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type & rType )
69 throw( css::uno::RuntimeException, std::exception ) override;
70 virtual void SAL_CALL acquire()
71 throw() override;
72 virtual void SAL_CALL release()
73 throw() override;
75 // XTypeProvider
76 virtual css::uno::Sequence< sal_Int8 > SAL_CALL
77 getImplementationId()
78 throw( css::uno::RuntimeException, std::exception ) override;
79 virtual css::uno::Sequence< css::uno::Type > SAL_CALL
80 getTypes()
81 throw( css::uno::RuntimeException, std::exception ) override;
83 // XPropertySetInfo
84 virtual css::uno::Sequence<
85 css::beans::Property > SAL_CALL
86 getProperties()
87 throw( css::uno::RuntimeException, std::exception ) override;
88 virtual css::beans::Property SAL_CALL
89 getPropertyByName( const OUString& aName )
90 throw( css::beans::UnknownPropertyException,
91 css::uno::RuntimeException, std::exception ) override;
92 virtual sal_Bool SAL_CALL
93 hasPropertyByName( const OUString& Name )
94 throw( css::uno::RuntimeException, std::exception ) override;
96 // Non-Interface methods.
97 void reset();
101 // class CommandProcessorInfo.
105 * This class provides a command info ( the complete implementation of
106 * the interface XCommandInfo ) for an object derived from class
107 * ucb::ContentImplHelper.
109 class CommandProcessorInfo :
110 public cppu::OWeakObject,
111 public css::lang::XTypeProvider,
112 public css::ucb::XCommandInfo
114 css::uno::Reference< css::ucb::XCommandEnvironment >
115 m_xEnv;
116 css::uno::Sequence< css::ucb::CommandInfo >*
117 m_pCommands;
118 osl::Mutex m_aMutex;
119 ContentImplHelper* m_pContent;
121 private:
122 bool queryCommand( const OUString& rName,
123 css::ucb::CommandInfo& rCommand );
124 bool queryCommand( sal_Int32 nHandle,
125 css::ucb::CommandInfo& rCommand );
127 public:
128 CommandProcessorInfo( const css::uno::Reference< css::ucb::XCommandEnvironment >& rxEnv,
129 ContentImplHelper* pContent );
130 virtual ~CommandProcessorInfo() override;
132 // XInterface
133 virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type & rType )
134 throw( css::uno::RuntimeException, std::exception ) override;
135 virtual void SAL_CALL acquire()
136 throw() override;
137 virtual void SAL_CALL release()
138 throw() override;
140 // XTypeProvider
141 virtual css::uno::Sequence< sal_Int8 > SAL_CALL
142 getImplementationId()
143 throw( css::uno::RuntimeException, std::exception ) override;
144 virtual css::uno::Sequence< css::uno::Type > SAL_CALL
145 getTypes()
146 throw( css::uno::RuntimeException, std::exception ) override;
148 // XCommandInfo
149 virtual css::uno::Sequence<
150 css::ucb::CommandInfo > SAL_CALL
151 getCommands()
152 throw( css::uno::RuntimeException, std::exception ) override;
153 virtual css::ucb::CommandInfo SAL_CALL
154 getCommandInfoByName( const OUString& Name )
155 throw( css::ucb::UnsupportedCommandException,
156 css::uno::RuntimeException, std::exception ) override;
157 virtual css::ucb::CommandInfo SAL_CALL
158 getCommandInfoByHandle( sal_Int32 Handle )
159 throw( css::ucb::UnsupportedCommandException,
160 css::uno::RuntimeException, std::exception ) override;
161 virtual sal_Bool SAL_CALL
162 hasCommandByName( const OUString& Name )
163 throw( css::uno::RuntimeException, std::exception ) override;
164 virtual sal_Bool SAL_CALL
165 hasCommandByHandle( sal_Int32 Handle )
166 throw( css::uno::RuntimeException, std::exception ) override;
168 // Non-Interface methods.
169 void reset();
172 } // namespace ucbhelper
174 #endif /* ! INCLUDED_UCBHELPER_CONTENTINFO_HXX */
176 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */