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
;
30 using namespace com::sun::star
;
32 using namespace chelp
;
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;
46 uno::Sequence
< beans::Property
> props(num
);
53 getCppuType( static_cast< const OUString
* >( 0 ) ),
54 beans::PropertyAttribute::BOUND
| beans::PropertyAttribute::READONLY
);
61 beans::PropertyAttribute::BOUND
| beans::PropertyAttribute::READONLY
);
68 beans::PropertyAttribute::BOUND
| beans::PropertyAttribute::READONLY
);
75 beans::PropertyAttribute::BOUND
| beans::PropertyAttribute::READONLY
);
82 beans::PropertyAttribute::BOUND
| beans::PropertyAttribute::READONLY
);
88 getCppuType( static_cast< const OUString
* >( 0 ) ),
89 beans::PropertyAttribute::BOUND
| beans::PropertyAttribute::READONLY
);
96 getCppuType( static_cast< const OUString
* >( 0 ) ),
97 beans::PropertyAttribute::BOUND
| beans::PropertyAttribute::READONLY
);
105 getCppuType( static_cast< sal_Int32
* >( 0 ) ),
106 beans::PropertyAttribute::BOUND
| beans::PropertyAttribute::READONLY
);
112 getCppuType( static_cast< const uno::Sequence
< OUString
>* >( 0 ) ),
113 beans::PropertyAttribute::BOUND
| beans::PropertyAttribute::READONLY
);
119 getCppuType( static_cast< const uno::Sequence
< uno::Sequence
< OUString
> >* >( 0 ) ),
120 beans::PropertyAttribute::BOUND
| beans::PropertyAttribute::READONLY
);
124 "KeywordTitleForRef",
126 getCppuType( static_cast< const uno::Sequence
< uno::Sequence
< OUString
> >* >( 0 ) ),
127 beans::PropertyAttribute::BOUND
| beans::PropertyAttribute::READONLY
);
131 "KeywordAnchorForRef",
133 getCppuType( static_cast< const uno::Sequence
< uno::Sequence
< OUString
> >* >( 0 ) ),
134 beans::PropertyAttribute::BOUND
| beans::PropertyAttribute::READONLY
);
140 getCppuType( static_cast< const uno::Sequence
< OUString
>* >( 0 ) ),
141 beans::PropertyAttribute::BOUND
| beans::PropertyAttribute::READONLY
);
150 getCppuType( static_cast< const OUString
* >( 0 ) ),
151 beans::PropertyAttribute::BOUND
| beans::PropertyAttribute::READONLY
);
159 //=========================================================================
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 ///////////////////////////////////////////////////////////////
176 ///////////////////////////////////////////////////////////////
177 star::ucb::CommandInfo(
182 star::ucb::CommandInfo(
183 "getPropertySetInfo",
187 star::ucb::CommandInfo(
190 getCppuType( static_cast< uno::Sequence
< beans::Property
> * >( 0 ) )
192 star::ucb::CommandInfo(
195 getCppuType( static_cast< uno::Sequence
< beans::PropertyValue
> * >( 0 ) )
197 star::ucb::CommandInfo(
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: */