fdo#74697 Add Bluez 5 support for impress remote.
[LibreOffice.git] / xmlhelp / source / cxxhelp / provider / contentcaps.cxx
blob9b442dc682f005824b805ed39dc740dadc2405d0
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 #include <com/sun/star/beans/Property.hpp>
21 #include <com/sun/star/beans/PropertyAttribute.hpp>
22 #include <com/sun/star/beans/PropertyValue.hpp>
23 #include <com/sun/star/ucb/CommandInfo.hpp>
24 #include <com/sun/star/ucb/OpenCommandArgument2.hpp>
25 #include <com/sun/star/uno/Sequence.hxx>
27 #include "content.hxx"
29 using namespace com::sun;
30 using namespace com::sun::star;
32 using namespace chelp;
34 // virtual
35 uno::Sequence< beans::Property > Content::getProperties(
36 const uno::Reference< star::ucb::XCommandEnvironment > & /*xEnv*/ )
38 bool withMediaType = m_aURLParameter.isFile() || m_aURLParameter.isRoot();
39 bool isModule = m_aURLParameter.isModule();
40 bool isFile = m_aURLParameter.isFile();
42 sal_Int32 num = withMediaType ? 7 : 6;
43 if( isModule ) num+=6;
44 if( isFile ) num++;
46 uno::Sequence< beans::Property > props(num);
48 sal_Int32 idx = 0;
49 props[idx++] =
50 beans::Property(
51 "ContentType",
52 -1,
53 getCppuType( static_cast< const OUString * >( 0 ) ),
54 beans::PropertyAttribute::BOUND | beans::PropertyAttribute::READONLY );
56 props[idx++] =
57 beans::Property(
58 "IsReadOnly",
59 -1,
60 getCppuBooleanType(),
61 beans::PropertyAttribute::BOUND | beans::PropertyAttribute::READONLY );
63 props[idx++] =
64 beans::Property(
65 "IsErrorDocument",
66 -1,
67 getCppuBooleanType(),
68 beans::PropertyAttribute::BOUND | beans::PropertyAttribute::READONLY );
70 props[idx++] =
71 beans::Property(
72 "IsDocument",
73 -1,
74 getCppuBooleanType(),
75 beans::PropertyAttribute::BOUND | beans::PropertyAttribute::READONLY );
77 props[idx++] =
78 beans::Property(
79 "IsFolder",
80 -1,
81 getCppuBooleanType(),
82 beans::PropertyAttribute::BOUND | beans::PropertyAttribute::READONLY );
84 props[idx++] =
85 beans::Property(
86 "Title",
87 -1,
88 getCppuType( static_cast< const OUString * >( 0 ) ),
89 beans::PropertyAttribute::BOUND | beans::PropertyAttribute::READONLY );
91 if( withMediaType )
92 props[idx++] =
93 beans::Property(
94 "MediaType",
95 -1,
96 getCppuType( static_cast< const OUString * >( 0 ) ),
97 beans::PropertyAttribute::BOUND | beans::PropertyAttribute::READONLY );
99 if( isModule )
101 props[idx++] =
102 beans::Property(
103 "Order",
105 getCppuType( static_cast< sal_Int32* >( 0 ) ),
106 beans::PropertyAttribute::BOUND | beans::PropertyAttribute::READONLY );
108 props[idx++] =
109 beans::Property(
110 "KeywordList",
112 getCppuType( static_cast< const uno::Sequence< OUString >* >( 0 ) ),
113 beans::PropertyAttribute::BOUND | beans::PropertyAttribute::READONLY );
115 props[idx++] =
116 beans::Property(
117 "KeywordRef",
119 getCppuType( static_cast< const uno::Sequence< uno::Sequence< OUString > >* >( 0 ) ),
120 beans::PropertyAttribute::BOUND | beans::PropertyAttribute::READONLY );
122 props[idx++] =
123 beans::Property(
124 "KeywordTitleForRef",
126 getCppuType( static_cast< const uno::Sequence< uno::Sequence< OUString > >* >( 0 ) ),
127 beans::PropertyAttribute::BOUND | beans::PropertyAttribute::READONLY );
129 props[idx++] =
130 beans::Property(
131 "KeywordAnchorForRef",
133 getCppuType( static_cast< const uno::Sequence< uno::Sequence< OUString > >* >( 0 ) ),
134 beans::PropertyAttribute::BOUND | beans::PropertyAttribute::READONLY );
136 props[idx++] =
137 beans::Property(
138 "SearchScopes",
140 getCppuType( static_cast< const uno::Sequence< OUString >* >( 0 ) ),
141 beans::PropertyAttribute::BOUND | beans::PropertyAttribute::READONLY );
144 if( isFile )
146 props[idx++] =
147 beans::Property(
148 "AnchorName",
150 getCppuType( static_cast< const OUString * >( 0 ) ),
151 beans::PropertyAttribute::BOUND | beans::PropertyAttribute::READONLY );
154 return props;
159 //=========================================================================
160 // virtual
161 uno::Sequence< star::ucb::CommandInfo > Content::getCommands(
162 const uno::Reference< star::ucb::XCommandEnvironment > & /*xEnv*/ )
164 //=================================================================
166 // Supported commands
168 //=================================================================
170 #define COMMAND_COUNT 5
172 static const star::ucb::CommandInfo aCommandInfoTable[] =
174 ///////////////////////////////////////////////////////////////
175 // Required commands
176 ///////////////////////////////////////////////////////////////
177 star::ucb::CommandInfo(
178 "getCommandInfo",
180 getCppuVoidType()
182 star::ucb::CommandInfo(
183 "getPropertySetInfo",
185 getCppuVoidType()
187 star::ucb::CommandInfo(
188 "getPropertyValues",
190 getCppuType( static_cast< uno::Sequence< beans::Property > * >( 0 ) )
192 star::ucb::CommandInfo(
193 "setPropertyValues",
195 getCppuType( static_cast< uno::Sequence< beans::PropertyValue > * >( 0 ) )
197 star::ucb::CommandInfo(
198 "open",
200 getCppuType( static_cast< star::ucb::OpenCommandArgument2 * >( 0 ) )
204 return uno::Sequence< star::ucb::CommandInfo >(
205 aCommandInfoTable, COMMAND_COUNT );
208 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */