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