xref: /AOO41X/main/ucb/source/ucp/ftp/ftpcontentcaps.cxx (revision 2f86921c33504fdff5a030df6c0b258927045abb)
1*2f86921cSAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*2f86921cSAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*2f86921cSAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*2f86921cSAndrew Rist  * distributed with this work for additional information
6*2f86921cSAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*2f86921cSAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*2f86921cSAndrew Rist  * "License"); you may not use this file except in compliance
9*2f86921cSAndrew Rist  * with the License.  You may obtain a copy of the License at
10cdf0e10cSrcweir  *
11*2f86921cSAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12cdf0e10cSrcweir  *
13*2f86921cSAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*2f86921cSAndrew Rist  * software distributed under the License is distributed on an
15*2f86921cSAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*2f86921cSAndrew Rist  * KIND, either express or implied.  See the License for the
17*2f86921cSAndrew Rist  * specific language governing permissions and limitations
18*2f86921cSAndrew Rist  * under the License.
19cdf0e10cSrcweir  *
20*2f86921cSAndrew Rist  *************************************************************/
21*2f86921cSAndrew Rist 
22*2f86921cSAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir // MARKER(update_precomp.py): autogen include statement, do not remove
25cdf0e10cSrcweir #include "precompiled_ucb.hxx"
26cdf0e10cSrcweir 
27cdf0e10cSrcweir #include <com/sun/star/beans/Property.hpp>
28cdf0e10cSrcweir #include <com/sun/star/beans/PropertyAttribute.hpp>
29cdf0e10cSrcweir #include <com/sun/star/beans/PropertyValue.hpp>
30cdf0e10cSrcweir #include <com/sun/star/ucb/CommandInfo.hpp>
31cdf0e10cSrcweir #include <com/sun/star/ucb/OpenCommandArgument2.hpp>
32cdf0e10cSrcweir #include <com/sun/star/ucb/InsertCommandArgument.hpp>
33cdf0e10cSrcweir #include <com/sun/star/util/DateTime.hpp>
34cdf0e10cSrcweir #include <com/sun/star/uno/Sequence.hxx>
35cdf0e10cSrcweir 
36cdf0e10cSrcweir #include "ftpcontent.hxx"
37cdf0e10cSrcweir 
38cdf0e10cSrcweir using namespace com::sun::star;
39cdf0e10cSrcweir using namespace ftp;
40cdf0e10cSrcweir 
41cdf0e10cSrcweir // virtual
getProperties(const uno::Reference<ucb::XCommandEnvironment> &)42cdf0e10cSrcweir uno::Sequence< beans::Property > FTPContent::getProperties(
43cdf0e10cSrcweir     const uno::Reference< ucb::XCommandEnvironment > & /*xEnv*/)
44cdf0e10cSrcweir {
45cdf0e10cSrcweir     #define PROPS_COUNT 8
46cdf0e10cSrcweir 
47cdf0e10cSrcweir     static const beans::Property aPropsInfoTable[] =
48cdf0e10cSrcweir     {
49cdf0e10cSrcweir         beans::Property(
50cdf0e10cSrcweir             rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ContentType" ) ),
51cdf0e10cSrcweir             -1,
52cdf0e10cSrcweir             getCppuType( static_cast< const rtl::OUString * >( 0 ) ),
53cdf0e10cSrcweir             beans::PropertyAttribute::BOUND
54cdf0e10cSrcweir             | beans::PropertyAttribute::READONLY
55cdf0e10cSrcweir         ),
56cdf0e10cSrcweir         beans::Property(
57cdf0e10cSrcweir             rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "IsDocument" ) ),
58cdf0e10cSrcweir             -1,
59cdf0e10cSrcweir             getCppuBooleanType(),
60cdf0e10cSrcweir             beans::PropertyAttribute::BOUND
61cdf0e10cSrcweir             | beans::PropertyAttribute::READONLY
62cdf0e10cSrcweir         ),
63cdf0e10cSrcweir         beans::Property(
64cdf0e10cSrcweir             rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "IsFolder" ) ),
65cdf0e10cSrcweir             -1,
66cdf0e10cSrcweir             getCppuBooleanType(),
67cdf0e10cSrcweir             beans::PropertyAttribute::BOUND
68cdf0e10cSrcweir             | beans::PropertyAttribute::READONLY
69cdf0e10cSrcweir         ),
70cdf0e10cSrcweir         beans::Property(
71cdf0e10cSrcweir             rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Title" ) ),
72cdf0e10cSrcweir             -1,
73cdf0e10cSrcweir             getCppuType( static_cast< const rtl::OUString * >( 0 ) ),
74cdf0e10cSrcweir             beans::PropertyAttribute::BOUND
75cdf0e10cSrcweir             //  | beans::PropertyAttribute::READONLY
76cdf0e10cSrcweir         ),
77cdf0e10cSrcweir         beans::Property(
78cdf0e10cSrcweir             rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Size" ) ),
79cdf0e10cSrcweir             -1,
80cdf0e10cSrcweir             getCppuType( static_cast< const sal_Int64 * >( 0 ) ),
81cdf0e10cSrcweir             beans::PropertyAttribute::BOUND
82cdf0e10cSrcweir             | beans::PropertyAttribute::READONLY
83cdf0e10cSrcweir         ),
84cdf0e10cSrcweir         beans::Property(
85cdf0e10cSrcweir             rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DateCreated" ) ),
86cdf0e10cSrcweir             -1,
87cdf0e10cSrcweir             getCppuType( static_cast< util::DateTime * >( 0 ) ),
88cdf0e10cSrcweir             beans::PropertyAttribute::BOUND
89cdf0e10cSrcweir             | beans::PropertyAttribute::READONLY
90cdf0e10cSrcweir         ),
91cdf0e10cSrcweir         beans::Property(
92cdf0e10cSrcweir             rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "IsReadOnly" ) ),
93cdf0e10cSrcweir             -1,
94cdf0e10cSrcweir             getCppuBooleanType(),
95cdf0e10cSrcweir             beans::PropertyAttribute::BOUND
96cdf0e10cSrcweir             | beans::PropertyAttribute::READONLY
97cdf0e10cSrcweir         ),
98cdf0e10cSrcweir         beans::Property(
99cdf0e10cSrcweir             rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(
100cdf0e10cSrcweir                 "CreatableContentsInfo" ) ),
101cdf0e10cSrcweir             -1,
102cdf0e10cSrcweir             getCppuType(
103cdf0e10cSrcweir                 static_cast< const uno::Sequence< ucb::ContentInfo > * >( 0 ) ),
104cdf0e10cSrcweir             beans::PropertyAttribute::BOUND
105cdf0e10cSrcweir             | beans::PropertyAttribute::READONLY
106cdf0e10cSrcweir         )
107cdf0e10cSrcweir     };
108cdf0e10cSrcweir 
109cdf0e10cSrcweir     return uno::Sequence< beans::Property >( aPropsInfoTable, PROPS_COUNT );
110cdf0e10cSrcweir }
111cdf0e10cSrcweir 
112cdf0e10cSrcweir //=========================================================================
113cdf0e10cSrcweir // virtual
getCommands(const uno::Reference<ucb::XCommandEnvironment> &)114cdf0e10cSrcweir uno::Sequence< ucb::CommandInfo > FTPContent::getCommands(
115cdf0e10cSrcweir     const uno::Reference< ucb::XCommandEnvironment > & /*xEnv*/ )
116cdf0e10cSrcweir {
117cdf0e10cSrcweir // osl::MutexGuard aGuard( m_aMutex );
118cdf0e10cSrcweir 
119cdf0e10cSrcweir     //=================================================================
120cdf0e10cSrcweir     //
121cdf0e10cSrcweir     // Supported commands
122cdf0e10cSrcweir     //
123cdf0e10cSrcweir     //=================================================================
124cdf0e10cSrcweir 
125cdf0e10cSrcweir     #define COMMAND_COUNT 8
126cdf0e10cSrcweir 
127cdf0e10cSrcweir     static const ucb::CommandInfo aCommandInfoTable[] =
128cdf0e10cSrcweir     {
129cdf0e10cSrcweir         ///////////////////////////////////////////////////////////////
130cdf0e10cSrcweir         // Required commands
131cdf0e10cSrcweir         ///////////////////////////////////////////////////////////////
132cdf0e10cSrcweir         ucb::CommandInfo(
133cdf0e10cSrcweir             rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "getCommandInfo" ) ),
134cdf0e10cSrcweir             -1,
135cdf0e10cSrcweir             getCppuVoidType()
136cdf0e10cSrcweir         ),
137cdf0e10cSrcweir         ucb::CommandInfo(
138cdf0e10cSrcweir             rtl::OUString(
139cdf0e10cSrcweir                 RTL_CONSTASCII_USTRINGPARAM( "getPropertySetInfo" ) ),
140cdf0e10cSrcweir             -1,
141cdf0e10cSrcweir             getCppuVoidType()
142cdf0e10cSrcweir         ),
143cdf0e10cSrcweir         ucb::CommandInfo(
144cdf0e10cSrcweir             rtl::OUString(
145cdf0e10cSrcweir                 RTL_CONSTASCII_USTRINGPARAM( "getPropertyValues" ) ),
146cdf0e10cSrcweir             -1,
147cdf0e10cSrcweir             getCppuType(
148cdf0e10cSrcweir                 static_cast< uno::Sequence< beans::Property > * >( 0 ) )
149cdf0e10cSrcweir         ),
150cdf0e10cSrcweir         ucb::CommandInfo(
151cdf0e10cSrcweir             rtl::OUString(
152cdf0e10cSrcweir                 RTL_CONSTASCII_USTRINGPARAM( "setPropertyValues" ) ),
153cdf0e10cSrcweir             -1,
154cdf0e10cSrcweir             getCppuType(
155cdf0e10cSrcweir                 static_cast< uno::Sequence< beans::PropertyValue > * >( 0 ) )
156cdf0e10cSrcweir         ),
157cdf0e10cSrcweir         ucb::CommandInfo(
158cdf0e10cSrcweir             rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "open" ) ),
159cdf0e10cSrcweir             -1,
160cdf0e10cSrcweir             getCppuType(
161cdf0e10cSrcweir                 static_cast< ucb::OpenCommandArgument2 * >( 0 ) )
162cdf0e10cSrcweir         ),
163cdf0e10cSrcweir         ucb::CommandInfo(
164cdf0e10cSrcweir             rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "insert" ) ),
165cdf0e10cSrcweir             -1,
166cdf0e10cSrcweir             getCppuType(
167cdf0e10cSrcweir                 static_cast< ucb::InsertCommandArgument * >( 0 ) )
168cdf0e10cSrcweir         ),
169cdf0e10cSrcweir         ucb::CommandInfo(
170cdf0e10cSrcweir             rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "delete" ) ),
171cdf0e10cSrcweir             -1,
172cdf0e10cSrcweir             getCppuBooleanType()
173cdf0e10cSrcweir         ),
174cdf0e10cSrcweir         ucb::CommandInfo(
175cdf0e10cSrcweir             rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "createNewContent" ) ),
176cdf0e10cSrcweir             -1,
177cdf0e10cSrcweir             getCppuType( static_cast< ucb::ContentInfo * >( 0 ) )
178cdf0e10cSrcweir         )
179cdf0e10cSrcweir     };
180cdf0e10cSrcweir 
181cdf0e10cSrcweir     return uno::Sequence< ucb::CommandInfo >( aCommandInfoTable, COMMAND_COUNT );
182cdf0e10cSrcweir }
183cdf0e10cSrcweir 
184