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
10*2f86921cSAndrew Rist  *
11*2f86921cSAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*2f86921cSAndrew Rist  *
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.
19*2f86921cSAndrew Rist  *
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 /**************************************************************************
28cdf0e10cSrcweir                                 TODO
29cdf0e10cSrcweir  **************************************************************************
30cdf0e10cSrcweir 
31cdf0e10cSrcweir     Props/Commands:
32cdf0e10cSrcweir 
33cdf0e10cSrcweir                         rootfolder folder  stream
34cdf0e10cSrcweir     ---------------------------------------------
35cdf0e10cSrcweir     ContentType           r         r         r
36cdf0e10cSrcweir     IsDocument            r         r         r
37cdf0e10cSrcweir     IsFolder              r         r         r
38cdf0e10cSrcweir     MediaType            (w)       (w)        w
39cdf0e10cSrcweir     Title                 r         w         w
40cdf0e10cSrcweir     Size                  -         -         r
41cdf0e10cSrcweir     CreatableContentsInfo r         r         r
42cdf0e10cSrcweir     Compressed            -         -         w
43cdf0e10cSrcweir     Encrypted             -         -         w
44cdf0e10cSrcweir     HasEncryptedEntries   r         -         -
45cdf0e10cSrcweir 
46cdf0e10cSrcweir     getCommandInfo        x         x         x
47cdf0e10cSrcweir     getPropertySetInfo    x         x         x
48cdf0e10cSrcweir     getPropertyValues     x         x         x
49cdf0e10cSrcweir     setPropertyValues     x         x         x
50cdf0e10cSrcweir     insert                -         x         x
51cdf0e10cSrcweir     delete                -         x         x
52cdf0e10cSrcweir     open                  x         x         x
53cdf0e10cSrcweir     transfer              x         x         -
54cdf0e10cSrcweir     flush                 x         x         -
55cdf0e10cSrcweir     createNewContent      x         x         -
56cdf0e10cSrcweir 
57cdf0e10cSrcweir  *************************************************************************/
58cdf0e10cSrcweir #include <com/sun/star/beans/Property.hpp>
59cdf0e10cSrcweir #include <com/sun/star/beans/PropertyAttribute.hpp>
60cdf0e10cSrcweir #include <com/sun/star/beans/PropertyValue.hpp>
61cdf0e10cSrcweir #include <com/sun/star/ucb/CommandInfo.hpp>
62cdf0e10cSrcweir #include <com/sun/star/ucb/OpenCommandArgument2.hpp>
63cdf0e10cSrcweir #include <com/sun/star/ucb/TransferInfo.hpp>
64cdf0e10cSrcweir #include <com/sun/star/uno/Sequence.hxx>
65cdf0e10cSrcweir #include "pkgcontent.hxx"
66cdf0e10cSrcweir 
67cdf0e10cSrcweir using namespace com::sun::star;
68cdf0e10cSrcweir using namespace package_ucp;
69cdf0e10cSrcweir 
70cdf0e10cSrcweir //=========================================================================
71cdf0e10cSrcweir //
72cdf0e10cSrcweir // Content implementation.
73cdf0e10cSrcweir //
74cdf0e10cSrcweir //=========================================================================
75cdf0e10cSrcweir 
76cdf0e10cSrcweir #define MAKEPROPSEQUENCE( a ) \
77cdf0e10cSrcweir     uno::Sequence< beans::Property >( a, sizeof( a )  / sizeof( a[ 0 ] ) )
78cdf0e10cSrcweir 
79cdf0e10cSrcweir #define MAKECMDSEQUENCE( a ) \
80cdf0e10cSrcweir     uno::Sequence< ucb::CommandInfo >( a, sizeof( a )  / sizeof( a[ 0 ] ) )
81cdf0e10cSrcweir 
82cdf0e10cSrcweir //=========================================================================
83cdf0e10cSrcweir //
84cdf0e10cSrcweir // IMPORTENT: If any property data ( name / type / ... ) are changed, then
85cdf0e10cSrcweir //            Content::getPropertyValues(...) must be adapted too!
86cdf0e10cSrcweir //
87cdf0e10cSrcweir //=========================================================================
88cdf0e10cSrcweir 
89cdf0e10cSrcweir // virtual
90cdf0e10cSrcweir uno::Sequence< beans::Property > Content::getProperties(
91cdf0e10cSrcweir             const uno::Reference< ucb::XCommandEnvironment > & /*xEnv*/ )
92cdf0e10cSrcweir {
93cdf0e10cSrcweir     osl::Guard< osl::Mutex > aGuard( m_aMutex );
94cdf0e10cSrcweir 
95cdf0e10cSrcweir     if ( isFolder() )
96cdf0e10cSrcweir     {
97cdf0e10cSrcweir         if ( m_aUri.isRootFolder() )
98cdf0e10cSrcweir         {
99cdf0e10cSrcweir             //=================================================================
100cdf0e10cSrcweir             //
101cdf0e10cSrcweir             // Root Folder: Supported properties
102cdf0e10cSrcweir             //
103cdf0e10cSrcweir             //=================================================================
104cdf0e10cSrcweir 
105cdf0e10cSrcweir             static const beans::Property aRootFolderPropertyInfoTable[] =
106cdf0e10cSrcweir             {
107cdf0e10cSrcweir                 ///////////////////////////////////////////////////////////////
108cdf0e10cSrcweir                 // Required properties
109cdf0e10cSrcweir                 ///////////////////////////////////////////////////////////////
110cdf0e10cSrcweir                 beans::Property(
111cdf0e10cSrcweir                     rtl::OUString(
112cdf0e10cSrcweir                         RTL_CONSTASCII_USTRINGPARAM( "ContentType" ) ),
113cdf0e10cSrcweir                     -1,
114cdf0e10cSrcweir                     getCppuType( static_cast< const rtl::OUString * >( 0 ) ),
115cdf0e10cSrcweir                     beans::PropertyAttribute::BOUND
116cdf0e10cSrcweir                         | beans::PropertyAttribute::READONLY
117cdf0e10cSrcweir                 ),
118cdf0e10cSrcweir                 beans::Property(
119cdf0e10cSrcweir                     rtl::OUString(
120cdf0e10cSrcweir                         RTL_CONSTASCII_USTRINGPARAM( "IsDocument" ) ),
121cdf0e10cSrcweir                     -1,
122cdf0e10cSrcweir                     getCppuBooleanType(),
123cdf0e10cSrcweir                     beans::PropertyAttribute::BOUND
124cdf0e10cSrcweir                         | beans::PropertyAttribute::READONLY
125cdf0e10cSrcweir                 ),
126cdf0e10cSrcweir                 beans::Property(
127cdf0e10cSrcweir                     rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "IsFolder" ) ),
128cdf0e10cSrcweir                     -1,
129cdf0e10cSrcweir                     getCppuBooleanType(),
130cdf0e10cSrcweir                     beans::PropertyAttribute::BOUND
131cdf0e10cSrcweir                         | beans::PropertyAttribute::READONLY
132cdf0e10cSrcweir                 ),
133cdf0e10cSrcweir                 beans::Property(
134cdf0e10cSrcweir                     rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Title" ) ),
135cdf0e10cSrcweir                     -1,
136cdf0e10cSrcweir                     getCppuType( static_cast< const rtl::OUString * >( 0 ) ),
137cdf0e10cSrcweir                     beans::PropertyAttribute::BOUND
138cdf0e10cSrcweir                         | beans::PropertyAttribute::READONLY
139cdf0e10cSrcweir                 ),
140cdf0e10cSrcweir                 ///////////////////////////////////////////////////////////////
141cdf0e10cSrcweir                 // Optional standard properties
142cdf0e10cSrcweir                 ///////////////////////////////////////////////////////////////
143cdf0e10cSrcweir                 beans::Property(
144cdf0e10cSrcweir                     rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "MediaType" ) ),
145cdf0e10cSrcweir                     -1,
146cdf0e10cSrcweir                     getCppuType( static_cast< const rtl::OUString * >( 0 ) ),
147cdf0e10cSrcweir                     beans::PropertyAttribute::BOUND
148cdf0e10cSrcweir                 ),
149cdf0e10cSrcweir                 beans::Property(
150cdf0e10cSrcweir                     rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(
151cdf0e10cSrcweir                         "CreatableContentsInfo" ) ),
152cdf0e10cSrcweir                     -1,
153cdf0e10cSrcweir                     getCppuType( static_cast<
154cdf0e10cSrcweir                         const uno::Sequence< ucb::ContentInfo > * >( 0 ) ),
155cdf0e10cSrcweir                     beans::PropertyAttribute::BOUND
156cdf0e10cSrcweir                         | beans::PropertyAttribute::READONLY
157cdf0e10cSrcweir                 ),
158cdf0e10cSrcweir                 ///////////////////////////////////////////////////////////////
159cdf0e10cSrcweir                 // New properties
160cdf0e10cSrcweir                 ///////////////////////////////////////////////////////////////
161cdf0e10cSrcweir                 beans::Property(
162cdf0e10cSrcweir                     rtl::OUString(
163cdf0e10cSrcweir                         RTL_CONSTASCII_USTRINGPARAM( "HasEncryptedEntries" ) ),
164cdf0e10cSrcweir                     -1,
165cdf0e10cSrcweir                     getCppuBooleanType(),
166cdf0e10cSrcweir                     beans::PropertyAttribute::BOUND
167cdf0e10cSrcweir                         | beans::PropertyAttribute::READONLY
168cdf0e10cSrcweir                 )
169cdf0e10cSrcweir             };
170cdf0e10cSrcweir             return MAKEPROPSEQUENCE( aRootFolderPropertyInfoTable );
171cdf0e10cSrcweir         }
172cdf0e10cSrcweir         else
173cdf0e10cSrcweir         {
174cdf0e10cSrcweir             //=================================================================
175cdf0e10cSrcweir             //
176cdf0e10cSrcweir             // Folder: Supported properties
177cdf0e10cSrcweir             //
178cdf0e10cSrcweir             //=================================================================
179cdf0e10cSrcweir 
180cdf0e10cSrcweir             static const beans::Property aFolderPropertyInfoTable[] =
181cdf0e10cSrcweir             {
182cdf0e10cSrcweir                 ///////////////////////////////////////////////////////////////
183cdf0e10cSrcweir                 // Required properties
184cdf0e10cSrcweir                 ///////////////////////////////////////////////////////////////
185cdf0e10cSrcweir                 beans::Property(
186cdf0e10cSrcweir                     rtl::OUString(
187cdf0e10cSrcweir                         RTL_CONSTASCII_USTRINGPARAM( "ContentType" ) ),
188cdf0e10cSrcweir                     -1,
189cdf0e10cSrcweir                     getCppuType( static_cast< const rtl::OUString * >( 0 ) ),
190cdf0e10cSrcweir                     beans::PropertyAttribute::BOUND
191cdf0e10cSrcweir                         | beans::PropertyAttribute::READONLY
192cdf0e10cSrcweir                 ),
193cdf0e10cSrcweir                 beans::Property(
194cdf0e10cSrcweir                     rtl::OUString(
195cdf0e10cSrcweir                         RTL_CONSTASCII_USTRINGPARAM( "IsDocument" ) ),
196cdf0e10cSrcweir                     -1,
197cdf0e10cSrcweir                     getCppuBooleanType(),
198cdf0e10cSrcweir                     beans::PropertyAttribute::BOUND
199cdf0e10cSrcweir                         | beans::PropertyAttribute::READONLY
200cdf0e10cSrcweir                 ),
201cdf0e10cSrcweir                 beans::Property(
202cdf0e10cSrcweir                     rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "IsFolder" ) ),
203cdf0e10cSrcweir                     -1,
204cdf0e10cSrcweir                     getCppuBooleanType(),
205cdf0e10cSrcweir                     beans::PropertyAttribute::BOUND
206cdf0e10cSrcweir                         | beans::PropertyAttribute::READONLY
207cdf0e10cSrcweir                 ),
208cdf0e10cSrcweir                 beans::Property(
209cdf0e10cSrcweir                     rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Title" ) ),
210cdf0e10cSrcweir                     -1,
211cdf0e10cSrcweir                     getCppuType( static_cast< const rtl::OUString * >( 0 ) ),
212cdf0e10cSrcweir                     beans::PropertyAttribute::BOUND
213cdf0e10cSrcweir                 ),
214cdf0e10cSrcweir                 ///////////////////////////////////////////////////////////////
215cdf0e10cSrcweir                 // Optional standard properties
216cdf0e10cSrcweir                 ///////////////////////////////////////////////////////////////
217cdf0e10cSrcweir                 beans::Property(
218cdf0e10cSrcweir                     rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "MediaType" ) ),
219cdf0e10cSrcweir                     -1,
220cdf0e10cSrcweir                     getCppuType( static_cast< const rtl::OUString * >( 0 ) ),
221cdf0e10cSrcweir                     beans::PropertyAttribute::BOUND
222cdf0e10cSrcweir                 ),
223cdf0e10cSrcweir                 beans::Property(
224cdf0e10cSrcweir                     rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(
225cdf0e10cSrcweir                         "CreatableContentsInfo" ) ),
226cdf0e10cSrcweir                     -1,
227cdf0e10cSrcweir                     getCppuType( static_cast<
228cdf0e10cSrcweir                         const uno::Sequence< ucb::ContentInfo > * >( 0 ) ),
229cdf0e10cSrcweir                     beans::PropertyAttribute::BOUND
230cdf0e10cSrcweir                         | beans::PropertyAttribute::READONLY
231cdf0e10cSrcweir                 )
232cdf0e10cSrcweir                 ///////////////////////////////////////////////////////////////
233cdf0e10cSrcweir                 // New properties
234cdf0e10cSrcweir                 ///////////////////////////////////////////////////////////////
235cdf0e10cSrcweir             };
236cdf0e10cSrcweir             return MAKEPROPSEQUENCE( aFolderPropertyInfoTable );
237cdf0e10cSrcweir         }
238cdf0e10cSrcweir     }
239cdf0e10cSrcweir     else
240cdf0e10cSrcweir     {
241cdf0e10cSrcweir         //=================================================================
242cdf0e10cSrcweir         //
243cdf0e10cSrcweir         // Stream: Supported properties
244cdf0e10cSrcweir         //
245cdf0e10cSrcweir         //=================================================================
246cdf0e10cSrcweir 
247cdf0e10cSrcweir         static const beans::Property aStreamPropertyInfoTable[] =
248cdf0e10cSrcweir         {
249cdf0e10cSrcweir             ///////////////////////////////////////////////////////////////
250cdf0e10cSrcweir             // Required properties
251cdf0e10cSrcweir             ///////////////////////////////////////////////////////////////
252cdf0e10cSrcweir             beans::Property(
253cdf0e10cSrcweir                 rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ContentType" ) ),
254cdf0e10cSrcweir                 -1,
255cdf0e10cSrcweir                 getCppuType( static_cast< const rtl::OUString * >( 0 ) ),
256cdf0e10cSrcweir                 beans::PropertyAttribute::BOUND
257cdf0e10cSrcweir                     | beans::PropertyAttribute::READONLY
258cdf0e10cSrcweir             ),
259cdf0e10cSrcweir             beans::Property(
260cdf0e10cSrcweir                 rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "IsDocument" ) ),
261cdf0e10cSrcweir                 -1,
262cdf0e10cSrcweir                 getCppuBooleanType(),
263cdf0e10cSrcweir                 beans::PropertyAttribute::BOUND
264cdf0e10cSrcweir                     | beans::PropertyAttribute::READONLY
265cdf0e10cSrcweir             ),
266cdf0e10cSrcweir             beans::Property(
267cdf0e10cSrcweir                 rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "IsFolder" ) ),
268cdf0e10cSrcweir                 -1,
269cdf0e10cSrcweir                 getCppuBooleanType(),
270cdf0e10cSrcweir                 beans::PropertyAttribute::BOUND
271cdf0e10cSrcweir                     | beans::PropertyAttribute::READONLY
272cdf0e10cSrcweir             ),
273cdf0e10cSrcweir             beans::Property(
274cdf0e10cSrcweir                 rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Title" ) ),
275cdf0e10cSrcweir                 -1,
276cdf0e10cSrcweir                 getCppuType( static_cast< const rtl::OUString * >( 0 ) ),
277cdf0e10cSrcweir                 beans::PropertyAttribute::BOUND
278cdf0e10cSrcweir             ),
279cdf0e10cSrcweir             ///////////////////////////////////////////////////////////////
280cdf0e10cSrcweir             // Optional standard properties
281cdf0e10cSrcweir             ///////////////////////////////////////////////////////////////
282cdf0e10cSrcweir             beans::Property(
283cdf0e10cSrcweir                 rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "MediaType" ) ),
284cdf0e10cSrcweir                 -1,
285cdf0e10cSrcweir                 getCppuType( static_cast< const rtl::OUString * >( 0 ) ),
286cdf0e10cSrcweir                 beans::PropertyAttribute::BOUND
287cdf0e10cSrcweir             ),
288cdf0e10cSrcweir             beans::Property(
289cdf0e10cSrcweir                 rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Size" ) ),
290cdf0e10cSrcweir                 -1,
291cdf0e10cSrcweir                 getCppuType( static_cast< const sal_Int64 * >( 0 ) ),
292cdf0e10cSrcweir                 beans::PropertyAttribute::BOUND
293cdf0e10cSrcweir                     | beans::PropertyAttribute::READONLY
294cdf0e10cSrcweir             ),
295cdf0e10cSrcweir             beans::Property(
296cdf0e10cSrcweir                 rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(
297cdf0e10cSrcweir                     "CreatableContentsInfo" ) ),
298cdf0e10cSrcweir                 -1,
299cdf0e10cSrcweir                 getCppuType( static_cast<
300cdf0e10cSrcweir                     const uno::Sequence< ucb::ContentInfo > * >( 0 ) ),
301cdf0e10cSrcweir                 beans::PropertyAttribute::BOUND
302cdf0e10cSrcweir                 | beans::PropertyAttribute::READONLY
303cdf0e10cSrcweir             ),
304cdf0e10cSrcweir             ///////////////////////////////////////////////////////////////
305cdf0e10cSrcweir             // New properties
306cdf0e10cSrcweir             ///////////////////////////////////////////////////////////////
307cdf0e10cSrcweir             beans::Property(
308cdf0e10cSrcweir                 rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Compressed" ) ),
309cdf0e10cSrcweir                 -1,
310cdf0e10cSrcweir                 getCppuBooleanType(),
311cdf0e10cSrcweir                 beans::PropertyAttribute::BOUND
312cdf0e10cSrcweir             ),
313cdf0e10cSrcweir             beans::Property(
314cdf0e10cSrcweir                 rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Encrypted" ) ),
315cdf0e10cSrcweir                 -1,
316cdf0e10cSrcweir                 getCppuBooleanType(),
317cdf0e10cSrcweir                 beans::PropertyAttribute::BOUND
318cdf0e10cSrcweir             )
319cdf0e10cSrcweir         };
320cdf0e10cSrcweir         return MAKEPROPSEQUENCE( aStreamPropertyInfoTable );
321cdf0e10cSrcweir     }
322cdf0e10cSrcweir }
323cdf0e10cSrcweir 
324cdf0e10cSrcweir //=========================================================================
325cdf0e10cSrcweir // virtual
326cdf0e10cSrcweir uno::Sequence< ucb::CommandInfo > Content::getCommands(
327cdf0e10cSrcweir             const uno::Reference< ucb::XCommandEnvironment > & /*xEnv*/ )
328cdf0e10cSrcweir {
329cdf0e10cSrcweir     osl::Guard< osl::Mutex > aGuard( m_aMutex );
330cdf0e10cSrcweir 
331cdf0e10cSrcweir     if ( isFolder() )
332cdf0e10cSrcweir     {
333cdf0e10cSrcweir         if ( m_aUri.isRootFolder() )
334cdf0e10cSrcweir         {
335cdf0e10cSrcweir             //=================================================================
336cdf0e10cSrcweir             //
337cdf0e10cSrcweir             // Root Folder: Supported commands
338cdf0e10cSrcweir             //
339cdf0e10cSrcweir             //=================================================================
340cdf0e10cSrcweir 
341cdf0e10cSrcweir             static const ucb::CommandInfo aRootFolderCommandInfoTable[] =
342cdf0e10cSrcweir             {
343cdf0e10cSrcweir                 ///////////////////////////////////////////////////////////
344cdf0e10cSrcweir                 // Required commands
345cdf0e10cSrcweir                 ///////////////////////////////////////////////////////////
346cdf0e10cSrcweir                 ucb::CommandInfo(
347cdf0e10cSrcweir                     rtl::OUString(
348cdf0e10cSrcweir                         RTL_CONSTASCII_USTRINGPARAM( "getCommandInfo" ) ),
349cdf0e10cSrcweir                     -1,
350cdf0e10cSrcweir                     getCppuVoidType()
351cdf0e10cSrcweir                 ),
352cdf0e10cSrcweir                 ucb::CommandInfo(
353cdf0e10cSrcweir                     rtl::OUString(
354cdf0e10cSrcweir                         RTL_CONSTASCII_USTRINGPARAM( "getPropertySetInfo" ) ),
355cdf0e10cSrcweir                     -1,
356cdf0e10cSrcweir                     getCppuVoidType()
357cdf0e10cSrcweir                 ),
358cdf0e10cSrcweir                 ucb::CommandInfo(
359cdf0e10cSrcweir                     rtl::OUString(
360cdf0e10cSrcweir                         RTL_CONSTASCII_USTRINGPARAM( "getPropertyValues" ) ),
361cdf0e10cSrcweir                     -1,
362cdf0e10cSrcweir                     getCppuType(
363cdf0e10cSrcweir                         static_cast<
364cdf0e10cSrcweir                             uno::Sequence< beans::Property > * >( 0 ) )
365cdf0e10cSrcweir                 ),
366cdf0e10cSrcweir                 ucb::CommandInfo(
367cdf0e10cSrcweir                     rtl::OUString(
368cdf0e10cSrcweir                         RTL_CONSTASCII_USTRINGPARAM( "setPropertyValues" ) ),
369cdf0e10cSrcweir                     -1,
370cdf0e10cSrcweir                     getCppuType(
371cdf0e10cSrcweir                         static_cast<
372cdf0e10cSrcweir                             uno::Sequence< beans::PropertyValue > * >( 0 ) )
373cdf0e10cSrcweir                 ),
374cdf0e10cSrcweir                 ///////////////////////////////////////////////////////////
375cdf0e10cSrcweir                 // Optional standard commands
376cdf0e10cSrcweir                 ///////////////////////////////////////////////////////////
377cdf0e10cSrcweir                 ucb::CommandInfo(
378cdf0e10cSrcweir                     rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "open" ) ),
379cdf0e10cSrcweir                     -1,
380cdf0e10cSrcweir                     getCppuType(
381cdf0e10cSrcweir                         static_cast< ucb::OpenCommandArgument2 * >( 0 ) )
382cdf0e10cSrcweir                 ),
383cdf0e10cSrcweir                 ucb::CommandInfo(
384cdf0e10cSrcweir                     rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "transfer" ) ),
385cdf0e10cSrcweir                     -1,
386cdf0e10cSrcweir                     getCppuType(
387cdf0e10cSrcweir                         static_cast< ucb::TransferInfo * >( 0 ) )
388cdf0e10cSrcweir                 ),
389cdf0e10cSrcweir                 ucb::CommandInfo(
390cdf0e10cSrcweir                     rtl::OUString(
391cdf0e10cSrcweir                         RTL_CONSTASCII_USTRINGPARAM( "createNewContent" ) ),
392cdf0e10cSrcweir                     -1,
393cdf0e10cSrcweir                     getCppuType( static_cast< ucb::ContentInfo * >( 0 ) )
394cdf0e10cSrcweir                 ),
395cdf0e10cSrcweir                 ///////////////////////////////////////////////////////////
396cdf0e10cSrcweir                 // New commands
397cdf0e10cSrcweir                 ///////////////////////////////////////////////////////////
398cdf0e10cSrcweir                 ucb::CommandInfo(
399cdf0e10cSrcweir                     rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "flush" ) ),
400cdf0e10cSrcweir                     -1,
401cdf0e10cSrcweir                     getCppuVoidType()
402cdf0e10cSrcweir                 )
403cdf0e10cSrcweir             };
404cdf0e10cSrcweir 
405cdf0e10cSrcweir             return MAKECMDSEQUENCE( aRootFolderCommandInfoTable );
406cdf0e10cSrcweir         }
407cdf0e10cSrcweir         else
408cdf0e10cSrcweir         {
409cdf0e10cSrcweir             //=================================================================
410cdf0e10cSrcweir             //
411cdf0e10cSrcweir             // Folder: Supported commands
412cdf0e10cSrcweir             //
413cdf0e10cSrcweir             //=================================================================
414cdf0e10cSrcweir 
415cdf0e10cSrcweir             static const ucb::CommandInfo aFolderCommandInfoTable[] =
416cdf0e10cSrcweir             {
417cdf0e10cSrcweir                 ///////////////////////////////////////////////////////////
418cdf0e10cSrcweir                 // Required commands
419cdf0e10cSrcweir                 ///////////////////////////////////////////////////////////
420cdf0e10cSrcweir                 ucb::CommandInfo(
421cdf0e10cSrcweir                     rtl::OUString(
422cdf0e10cSrcweir                         RTL_CONSTASCII_USTRINGPARAM( "getCommandInfo" ) ),
423cdf0e10cSrcweir                     -1,
424cdf0e10cSrcweir                     getCppuVoidType()
425cdf0e10cSrcweir                 ),
426cdf0e10cSrcweir                 ucb::CommandInfo(
427cdf0e10cSrcweir                     rtl::OUString(
428cdf0e10cSrcweir                         RTL_CONSTASCII_USTRINGPARAM( "getPropertySetInfo" ) ),
429cdf0e10cSrcweir                     -1,
430cdf0e10cSrcweir                     getCppuVoidType()
431cdf0e10cSrcweir                 ),
432cdf0e10cSrcweir                 ucb::CommandInfo(
433cdf0e10cSrcweir                     rtl::OUString(
434cdf0e10cSrcweir                         RTL_CONSTASCII_USTRINGPARAM( "getPropertyValues" ) ),
435cdf0e10cSrcweir                     -1,
436cdf0e10cSrcweir                     getCppuType(
437cdf0e10cSrcweir                         static_cast<
438cdf0e10cSrcweir                             uno::Sequence< beans::Property > * >( 0 ) )
439cdf0e10cSrcweir                 ),
440cdf0e10cSrcweir                 ucb::CommandInfo(
441cdf0e10cSrcweir                     rtl::OUString(
442cdf0e10cSrcweir                         RTL_CONSTASCII_USTRINGPARAM( "setPropertyValues" ) ),
443cdf0e10cSrcweir                     -1,
444cdf0e10cSrcweir                     getCppuType(
445cdf0e10cSrcweir                         static_cast<
446cdf0e10cSrcweir                             uno::Sequence< beans::PropertyValue > * >( 0 ) )
447cdf0e10cSrcweir                 ),
448cdf0e10cSrcweir                 ///////////////////////////////////////////////////////////
449cdf0e10cSrcweir                 // Optional standard commands
450cdf0e10cSrcweir                 ///////////////////////////////////////////////////////////
451cdf0e10cSrcweir                 ucb::CommandInfo(
452cdf0e10cSrcweir                     rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "delete" ) ),
453cdf0e10cSrcweir                     -1,
454cdf0e10cSrcweir                     getCppuBooleanType()
455cdf0e10cSrcweir                 ),
456cdf0e10cSrcweir                 ucb::CommandInfo(
457cdf0e10cSrcweir                     rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "insert" ) ),
458cdf0e10cSrcweir                     -1,
459cdf0e10cSrcweir                     getCppuVoidType()
460cdf0e10cSrcweir                 ),
461cdf0e10cSrcweir                 ucb::CommandInfo(
462cdf0e10cSrcweir                     rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "open" ) ),
463cdf0e10cSrcweir                     -1,
464cdf0e10cSrcweir                     getCppuType(
465cdf0e10cSrcweir                         static_cast< ucb::OpenCommandArgument2 * >( 0 ) )
466cdf0e10cSrcweir                 ),
467cdf0e10cSrcweir                 ucb::CommandInfo(
468cdf0e10cSrcweir                     rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "transfer" ) ),
469cdf0e10cSrcweir                     -1,
470cdf0e10cSrcweir                     getCppuType(
471cdf0e10cSrcweir                         static_cast< ucb::TransferInfo * >( 0 ) )
472cdf0e10cSrcweir                 ),
473cdf0e10cSrcweir                 ucb::CommandInfo(
474cdf0e10cSrcweir                     rtl::OUString(
475cdf0e10cSrcweir                         RTL_CONSTASCII_USTRINGPARAM( "createNewContent" ) ),
476cdf0e10cSrcweir                     -1,
477cdf0e10cSrcweir                     getCppuType( static_cast< ucb::ContentInfo * >( 0 ) )
478cdf0e10cSrcweir                 ),
479cdf0e10cSrcweir                 ///////////////////////////////////////////////////////////
480cdf0e10cSrcweir                 // New commands
481cdf0e10cSrcweir                 ///////////////////////////////////////////////////////////
482cdf0e10cSrcweir                 ucb::CommandInfo(
483cdf0e10cSrcweir                     rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "flush" ) ),
484cdf0e10cSrcweir                     -1,
485cdf0e10cSrcweir                     getCppuVoidType()
486cdf0e10cSrcweir                 )
487cdf0e10cSrcweir             };
488cdf0e10cSrcweir 
489cdf0e10cSrcweir             return MAKECMDSEQUENCE( aFolderCommandInfoTable );
490cdf0e10cSrcweir         }
491cdf0e10cSrcweir     }
492cdf0e10cSrcweir     else
493cdf0e10cSrcweir     {
494cdf0e10cSrcweir         //=================================================================
495cdf0e10cSrcweir         //
496cdf0e10cSrcweir         // Stream: Supported commands
497cdf0e10cSrcweir         //
498cdf0e10cSrcweir         //=================================================================
499cdf0e10cSrcweir 
500cdf0e10cSrcweir         static const ucb::CommandInfo aStreamCommandInfoTable[] =
501cdf0e10cSrcweir         {
502cdf0e10cSrcweir             ///////////////////////////////////////////////////////////////
503cdf0e10cSrcweir             // Required commands
504cdf0e10cSrcweir             ///////////////////////////////////////////////////////////////
505cdf0e10cSrcweir             ucb::CommandInfo(
506cdf0e10cSrcweir                 rtl::OUString(
507cdf0e10cSrcweir                     RTL_CONSTASCII_USTRINGPARAM( "getCommandInfo" ) ),
508cdf0e10cSrcweir                 -1,
509cdf0e10cSrcweir                 getCppuVoidType()
510cdf0e10cSrcweir             ),
511cdf0e10cSrcweir             ucb::CommandInfo(
512cdf0e10cSrcweir                 rtl::OUString(
513cdf0e10cSrcweir                     RTL_CONSTASCII_USTRINGPARAM( "getPropertySetInfo" ) ),
514cdf0e10cSrcweir                 -1,
515cdf0e10cSrcweir                 getCppuVoidType()
516cdf0e10cSrcweir             ),
517cdf0e10cSrcweir             ucb::CommandInfo(
518cdf0e10cSrcweir                 rtl::OUString(
519cdf0e10cSrcweir                     RTL_CONSTASCII_USTRINGPARAM( "getPropertyValues" ) ),
520cdf0e10cSrcweir                 -1,
521cdf0e10cSrcweir                 getCppuType(
522cdf0e10cSrcweir                     static_cast< uno::Sequence< beans::Property > * >( 0 ) )
523cdf0e10cSrcweir             ),
524cdf0e10cSrcweir             ucb::CommandInfo(
525cdf0e10cSrcweir                 rtl::OUString(
526cdf0e10cSrcweir                     RTL_CONSTASCII_USTRINGPARAM( "setPropertyValues" ) ),
527cdf0e10cSrcweir                 -1,
528cdf0e10cSrcweir                 getCppuType(
529cdf0e10cSrcweir                     static_cast<
530cdf0e10cSrcweir                         uno::Sequence< beans::PropertyValue > * >( 0 ) )
531cdf0e10cSrcweir             ),
532cdf0e10cSrcweir             ///////////////////////////////////////////////////////////////
533cdf0e10cSrcweir             // Optional standard commands
534cdf0e10cSrcweir             ///////////////////////////////////////////////////////////////
535cdf0e10cSrcweir             ucb::CommandInfo(
536cdf0e10cSrcweir                 rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "delete" ) ),
537cdf0e10cSrcweir                 -1,
538cdf0e10cSrcweir                 getCppuBooleanType()
539cdf0e10cSrcweir             ),
540cdf0e10cSrcweir             ucb::CommandInfo(
541cdf0e10cSrcweir                 rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "insert" ) ),
542cdf0e10cSrcweir                 -1,
543cdf0e10cSrcweir                 getCppuVoidType()
544cdf0e10cSrcweir             ),
545cdf0e10cSrcweir             ucb::CommandInfo(
546cdf0e10cSrcweir                 rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "open" ) ),
547cdf0e10cSrcweir                 -1,
548cdf0e10cSrcweir                 getCppuType(
549cdf0e10cSrcweir                     static_cast< ucb::OpenCommandArgument2 * >( 0 ) )
550cdf0e10cSrcweir             )
551cdf0e10cSrcweir             ///////////////////////////////////////////////////////////////
552cdf0e10cSrcweir             // New commands
553cdf0e10cSrcweir             ///////////////////////////////////////////////////////////////
554cdf0e10cSrcweir         };
555cdf0e10cSrcweir 
556cdf0e10cSrcweir         return MAKECMDSEQUENCE( aStreamCommandInfoTable );
557cdf0e10cSrcweir     }
558cdf0e10cSrcweir }
559