1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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::star
;
31 using namespace chelp
;
34 uno::Sequence
< beans::Property
> Content::getProperties(
35 const uno::Reference
< ucb::XCommandEnvironment
> & /*xEnv*/ )
37 bool withMediaType
= m_aURLParameter
.isFile() || m_aURLParameter
.isRoot();
38 bool isModule
= m_aURLParameter
.isModule();
39 bool isFile
= m_aURLParameter
.isFile();
41 sal_Int32 num
= withMediaType
? 7 : 6;
42 if( isModule
) num
+=6;
45 uno::Sequence
< beans::Property
> props(num
);
46 auto pprops
= props
.getArray();
53 cppu::UnoType
<OUString
>::get(),
54 beans::PropertyAttribute::BOUND
| beans::PropertyAttribute::READONLY
);
60 cppu::UnoType
<bool>::get(),
61 beans::PropertyAttribute::BOUND
| beans::PropertyAttribute::READONLY
);
65 u
"IsErrorDocument"_ustr
,
67 cppu::UnoType
<bool>::get(),
68 beans::PropertyAttribute::BOUND
| beans::PropertyAttribute::READONLY
);
74 cppu::UnoType
<bool>::get(),
75 beans::PropertyAttribute::BOUND
| beans::PropertyAttribute::READONLY
);
81 cppu::UnoType
<bool>::get(),
82 beans::PropertyAttribute::BOUND
| beans::PropertyAttribute::READONLY
);
88 cppu::UnoType
<OUString
>::get(),
89 beans::PropertyAttribute::BOUND
| beans::PropertyAttribute::READONLY
);
96 cppu::UnoType
<OUString
>::get(),
97 beans::PropertyAttribute::BOUND
| beans::PropertyAttribute::READONLY
);
105 cppu::UnoType
<sal_Int32
>::get(),
106 beans::PropertyAttribute::BOUND
| beans::PropertyAttribute::READONLY
);
112 cppu::UnoType
<uno::Sequence
< OUString
>>::get(),
113 beans::PropertyAttribute::BOUND
| beans::PropertyAttribute::READONLY
);
119 cppu::UnoType
<uno::Sequence
< uno::Sequence
< OUString
> >>::get(),
120 beans::PropertyAttribute::BOUND
| beans::PropertyAttribute::READONLY
);
124 u
"KeywordTitleForRef"_ustr
,
126 cppu::UnoType
<uno::Sequence
< uno::Sequence
< OUString
> >>::get(),
127 beans::PropertyAttribute::BOUND
| beans::PropertyAttribute::READONLY
);
131 u
"KeywordAnchorForRef"_ustr
,
133 cppu::UnoType
<uno::Sequence
< uno::Sequence
< OUString
> >>::get(),
134 beans::PropertyAttribute::BOUND
| beans::PropertyAttribute::READONLY
);
138 u
"SearchScopes"_ustr
,
140 cppu::UnoType
<uno::Sequence
< OUString
>>::get(),
141 beans::PropertyAttribute::BOUND
| beans::PropertyAttribute::READONLY
);
150 cppu::UnoType
<OUString
>::get(),
151 beans::PropertyAttribute::BOUND
| beans::PropertyAttribute::READONLY
);
158 uno::Sequence
< ucb::CommandInfo
> Content::getCommands(
159 const uno::Reference
< ucb::XCommandEnvironment
> & /*xEnv*/ )
161 // Supported commands
163 #define COMMAND_COUNT 5
165 static const ucb::CommandInfo aCommandInfoTable
[] =
169 u
"getCommandInfo"_ustr
,
171 cppu::UnoType
<void>::get()
174 u
"getPropertySetInfo"_ustr
,
176 cppu::UnoType
<void>::get()
179 u
"getPropertyValues"_ustr
,
181 cppu::UnoType
<uno::Sequence
< beans::Property
>>::get()
184 u
"setPropertyValues"_ustr
,
186 cppu::UnoType
<uno::Sequence
< beans::PropertyValue
>>::get()
191 cppu::UnoType
<ucb::OpenCommandArgument2
>::get()
195 return uno::Sequence
< ucb::CommandInfo
>(
196 aCommandInfoTable
, COMMAND_COUNT
);
199 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */