Branch data Line data Source code
1 : : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : : /*************************************************************************
3 : : *
4 : : * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 : : *
6 : : * Copyright 2000, 2010 Oracle and/or its affiliates.
7 : : *
8 : : * OpenOffice.org - a multi-platform office productivity suite
9 : : *
10 : : * This file is part of OpenOffice.org.
11 : : *
12 : : * OpenOffice.org is free software: you can redistribute it and/or modify
13 : : * it under the terms of the GNU Lesser General Public License version 3
14 : : * only, as published by the Free Software Foundation.
15 : : *
16 : : * OpenOffice.org is distributed in the hope that it will be useful,
17 : : * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 : : * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 : : * GNU Lesser General Public License version 3 for more details
20 : : * (a copy is included in the LICENSE file that accompanied this code).
21 : : *
22 : : * You should have received a copy of the GNU Lesser General Public License
23 : : * version 3 along with OpenOffice.org. If not, see
24 : : * <http://www.openoffice.org/license.html>
25 : : * for a copy of the LGPLv3 License.
26 : : *
27 : : ************************************************************************/
28 : :
29 : :
30 : : /**************************************************************************
31 : : TODO
32 : : **************************************************************************
33 : :
34 : : **************************************************************************
35 : :
36 : : Props/Commands:
37 : :
38 : : root document folder folder stream stream
39 : : (new) (new)
40 : : ----------------------------------------------------------------
41 : : ContentType r r r r r r
42 : : IsDocument r r r r r r
43 : : IsFolder r r r r r r
44 : : Title r r w w w w
45 : : CreatableContentsInfo r r r r r r
46 : : Storage - - r r - -
47 : : DocumentModel - r - - - -
48 : :
49 : : getCommandInfo x x x x x x
50 : : getPropertySetInfo x x x x x x
51 : : getPropertyValues x x x x x x
52 : : setPropertyValues x x x x x x
53 : : insert - - x x x(*) x(*)
54 : : delete - - x - x -
55 : : open x x x - x -
56 : : transfer - x x - - -
57 : : createNewContent - x x - - -
58 : :
59 : : #ifdef NO_STREAM_CREATION_WITHIN_DOCUMENT_ROOT
60 : : (*) not supported by streams that are direct children of document
61 : : #endif
62 : :
63 : : *************************************************************************/
64 : :
65 : : #include <com/sun/star/beans/Property.hpp>
66 : : #include <com/sun/star/beans/PropertyAttribute.hpp>
67 : : #include <com/sun/star/beans/PropertyValue.hpp>
68 : : #include <com/sun/star/embed/XStorage.hpp>
69 : : #include <com/sun/star/frame/XModel.hpp>
70 : : #include <com/sun/star/ucb/CommandInfo.hpp>
71 : : #include <com/sun/star/ucb/OpenCommandArgument2.hpp>
72 : : #include <com/sun/star/ucb/TransferInfo.hpp>
73 : : #include <sal/macros.h>
74 : : #include <tdoc_content.hxx>
75 : :
76 : : namespace com { namespace sun { namespace star { namespace embed {
77 : : class XStorage;
78 : : } } } }
79 : :
80 : : using namespace com::sun::star;
81 : : using namespace tdoc_ucp;
82 : :
83 : : //=========================================================================
84 : : //
85 : : // Content implementation.
86 : : //
87 : : //=========================================================================
88 : :
89 : : #define MAKEPROPSEQUENCE( a ) \
90 : : uno::Sequence< beans::Property >( a, (sizeof (a) / sizeof (a[0])) )
91 : :
92 : : #define MAKECMDSEQUENCE( a ) \
93 : : uno::Sequence< ucb::CommandInfo >( a, (sizeof (a) / sizeof (a[0])) )
94 : :
95 : : //=========================================================================
96 : : //
97 : : // IMPORTENT: If any property data ( name / type / ... ) are changed, then
98 : : // Content::getPropertyValues(...) must be adapted too!
99 : : //
100 : : //=========================================================================
101 : :
102 : : // virtual
103 : 0 : uno::Sequence< beans::Property > Content::getProperties(
104 : : const uno::Reference< ucb::XCommandEnvironment > & /*xEnv*/ )
105 : : {
106 [ # # ]: 0 : osl::Guard< osl::Mutex > aGuard( m_aMutex );
107 : :
108 [ # # ]: 0 : if ( m_aProps.getType() == STREAM )
109 : : {
110 : : //=================================================================
111 : : //
112 : : // Stream: Supported properties
113 : : //
114 : : //=================================================================
115 : :
116 : : static const beans::Property aStreamPropertyInfoTable[] =
117 : : {
118 : : ///////////////////////////////////////////////////////////
119 : : // Mandatory properties
120 : : ///////////////////////////////////////////////////////////
121 : : beans::Property(
122 : : rtl::OUString(
123 : : RTL_CONSTASCII_USTRINGPARAM( "ContentType" ) ),
124 : : -1,
125 [ # # ]: 0 : getCppuType( static_cast< const rtl::OUString * >( 0 ) ),
126 : : beans::PropertyAttribute::BOUND
127 : : | beans::PropertyAttribute::READONLY
128 : : ),
129 : : beans::Property(
130 : : rtl::OUString(
131 : : RTL_CONSTASCII_USTRINGPARAM( "IsDocument" ) ),
132 : : -1,
133 [ # # ]: 0 : getCppuBooleanType(),
134 : : beans::PropertyAttribute::BOUND
135 : : | beans::PropertyAttribute::READONLY
136 : : ),
137 : : beans::Property(
138 : : rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "IsFolder" ) ),
139 : : -1,
140 [ # # ]: 0 : getCppuBooleanType(),
141 : : beans::PropertyAttribute::BOUND
142 : : | beans::PropertyAttribute::READONLY
143 : : ),
144 : : beans::Property(
145 : : rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Title" ) ),
146 : : -1,
147 [ # # ]: 0 : getCppuType( static_cast< const rtl::OUString * >( 0 ) ),
148 : : beans::PropertyAttribute::BOUND
149 : : ),
150 : : ///////////////////////////////////////////////////////////
151 : : // Optional standard properties
152 : : ///////////////////////////////////////////////////////////
153 : : beans::Property(
154 : : rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(
155 : : "CreatableContentsInfo" ) ),
156 : : -1,
157 : : getCppuType( static_cast<
158 [ # # ]: 0 : const uno::Sequence< ucb::ContentInfo > * >( 0 ) ),
159 : : beans::PropertyAttribute::BOUND
160 : : | beans::PropertyAttribute::READONLY
161 : : )
162 : : ///////////////////////////////////////////////////////////
163 : : // New properties
164 : : ///////////////////////////////////////////////////////////
165 [ # # ][ # # ]: 0 : };
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # #
# # # # ]
[ # # ]
166 [ # # ]: 0 : return MAKEPROPSEQUENCE( aStreamPropertyInfoTable );
167 : : }
168 [ # # ]: 0 : else if ( m_aProps.getType() == FOLDER )
169 : : {
170 : : //=================================================================
171 : : //
172 : : // Folder: Supported properties
173 : : //
174 : : //=================================================================
175 : :
176 : : static const beans::Property aFolderPropertyInfoTable[] =
177 : : {
178 : : ///////////////////////////////////////////////////////////
179 : : // Mandatory properties
180 : : ///////////////////////////////////////////////////////////
181 : : beans::Property(
182 : : rtl::OUString(
183 : : RTL_CONSTASCII_USTRINGPARAM( "ContentType" ) ),
184 : : -1,
185 [ # # ]: 0 : getCppuType( static_cast< const rtl::OUString * >( 0 ) ),
186 : : beans::PropertyAttribute::BOUND
187 : : | beans::PropertyAttribute::READONLY
188 : : ),
189 : : beans::Property(
190 : : rtl::OUString(
191 : : RTL_CONSTASCII_USTRINGPARAM( "IsDocument" ) ),
192 : : -1,
193 [ # # ]: 0 : getCppuBooleanType(),
194 : : beans::PropertyAttribute::BOUND
195 : : | beans::PropertyAttribute::READONLY
196 : : ),
197 : : beans::Property(
198 : : rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "IsFolder" ) ),
199 : : -1,
200 [ # # ]: 0 : getCppuBooleanType(),
201 : : beans::PropertyAttribute::BOUND
202 : : | beans::PropertyAttribute::READONLY
203 : : ),
204 : : beans::Property(
205 : : rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Title" ) ),
206 : : -1,
207 [ # # ]: 0 : getCppuType( static_cast< const rtl::OUString * >( 0 ) ),
208 : : beans::PropertyAttribute::BOUND
209 : : ),
210 : : ///////////////////////////////////////////////////////////
211 : : // Optional standard properties
212 : : ///////////////////////////////////////////////////////////
213 : : beans::Property(
214 : : rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(
215 : : "CreatableContentsInfo" ) ),
216 : : -1,
217 : : getCppuType( static_cast<
218 [ # # ]: 0 : const uno::Sequence< ucb::ContentInfo > * >( 0 ) ),
219 : : beans::PropertyAttribute::BOUND
220 : : | beans::PropertyAttribute::READONLY
221 : : ),
222 : : ///////////////////////////////////////////////////////////
223 : : // New properties
224 : : ///////////////////////////////////////////////////////////
225 : : beans::Property(
226 : : rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Storage" ) ),
227 : : -1,
228 : : getCppuType( static_cast<
229 [ # # ]: 0 : const uno::Reference< embed::XStorage > * >( 0 ) ),
230 : : beans::PropertyAttribute::BOUND
231 : : | beans::PropertyAttribute::READONLY
232 : : )
233 [ # # ][ # # ]: 0 : };
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # # #
# # ][ # # ]
234 [ # # ]: 0 : return MAKEPROPSEQUENCE( aFolderPropertyInfoTable );
235 : : }
236 [ # # ]: 0 : else if ( m_aProps.getType() == DOCUMENT )
237 : : {
238 : : //=================================================================
239 : : //
240 : : // Document: Supported properties
241 : : //
242 : : //=================================================================
243 : :
244 : : static const beans::Property aDocPropertyInfoTable[] =
245 : : {
246 : : ///////////////////////////////////////////////////////////
247 : : // Mandatory properties
248 : : ///////////////////////////////////////////////////////////
249 : : beans::Property(
250 : : rtl::OUString(
251 : : RTL_CONSTASCII_USTRINGPARAM( "ContentType" ) ),
252 : : -1,
253 [ # # ]: 0 : getCppuType( static_cast< const rtl::OUString * >( 0 ) ),
254 : : beans::PropertyAttribute::BOUND
255 : : | beans::PropertyAttribute::READONLY
256 : : ),
257 : : beans::Property(
258 : : rtl::OUString(
259 : : RTL_CONSTASCII_USTRINGPARAM( "IsDocument" ) ),
260 : : -1,
261 [ # # ]: 0 : getCppuBooleanType(),
262 : : beans::PropertyAttribute::BOUND
263 : : | beans::PropertyAttribute::READONLY
264 : : ),
265 : : beans::Property(
266 : : rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "IsFolder" ) ),
267 : : -1,
268 [ # # ]: 0 : getCppuBooleanType(),
269 : : beans::PropertyAttribute::BOUND
270 : : | beans::PropertyAttribute::READONLY
271 : : ),
272 : : beans::Property(
273 : : rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Title" ) ),
274 : : -1,
275 [ # # ]: 0 : getCppuType( static_cast< const rtl::OUString * >( 0 ) ),
276 : : beans::PropertyAttribute::BOUND
277 : : | beans::PropertyAttribute::READONLY
278 : : ),
279 : : ///////////////////////////////////////////////////////////
280 : : // Optional standard properties
281 : : ///////////////////////////////////////////////////////////
282 : : beans::Property(
283 : : rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(
284 : : "CreatableContentsInfo" ) ),
285 : : -1,
286 : : getCppuType( static_cast<
287 [ # # ]: 0 : const uno::Sequence< ucb::ContentInfo > * >( 0 ) ),
288 : : beans::PropertyAttribute::BOUND
289 : : | beans::PropertyAttribute::READONLY
290 : : ),
291 : : ///////////////////////////////////////////////////////////
292 : : // New properties
293 : : ///////////////////////////////////////////////////////////
294 : : beans::Property(
295 : : rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DocumentModel" ) ),
296 : : -1,
297 : : getCppuType( static_cast<
298 [ # # ]: 0 : const uno::Reference< frame::XModel > * >( 0 ) ),
299 : : beans::PropertyAttribute::BOUND
300 : : | beans::PropertyAttribute::READONLY
301 : : )
302 [ # # ][ # # ]: 0 : };
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # # #
# # ][ # # ]
303 [ # # ]: 0 : return MAKEPROPSEQUENCE( aDocPropertyInfoTable );
304 : : }
305 : : else
306 : : {
307 : : //=================================================================
308 : : //
309 : : // Root: Supported properties
310 : : //
311 : : //=================================================================
312 : :
313 : : OSL_ENSURE( m_aProps.getType() == ROOT, "Wrong content type!" );
314 : :
315 : : static const beans::Property aRootPropertyInfoTable[] =
316 : : {
317 : : ///////////////////////////////////////////////////////////////
318 : : // Mandatory properties
319 : : ///////////////////////////////////////////////////////////////
320 : : beans::Property(
321 : : rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ContentType" ) ),
322 : : -1,
323 [ # # ]: 0 : getCppuType( static_cast< const rtl::OUString * >( 0 ) ),
324 : : beans::PropertyAttribute::BOUND
325 : : | beans::PropertyAttribute::READONLY
326 : : ),
327 : : beans::Property(
328 : : rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "IsDocument" ) ),
329 : : -1,
330 [ # # ]: 0 : getCppuBooleanType(),
331 : : beans::PropertyAttribute::BOUND
332 : : | beans::PropertyAttribute::READONLY
333 : : ),
334 : : beans::Property(
335 : : rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "IsFolder" ) ),
336 : : -1,
337 [ # # ]: 0 : getCppuBooleanType(),
338 : : beans::PropertyAttribute::BOUND
339 : : | beans::PropertyAttribute::READONLY
340 : : ),
341 : : beans::Property(
342 : : rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Title" ) ),
343 : : -1,
344 [ # # ]: 0 : getCppuType( static_cast< const rtl::OUString * >( 0 ) ),
345 : : beans::PropertyAttribute::BOUND
346 : : | beans::PropertyAttribute::READONLY
347 : : ),
348 : : ///////////////////////////////////////////////////////////////
349 : : // Optional standard properties
350 : : ///////////////////////////////////////////////////////////////
351 : : beans::Property(
352 : : rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(
353 : : "CreatableContentsInfo" ) ),
354 : : -1,
355 : : getCppuType( static_cast<
356 [ # # ]: 0 : const uno::Sequence< ucb::ContentInfo > * >( 0 ) ),
357 : : beans::PropertyAttribute::BOUND
358 : : | beans::PropertyAttribute::READONLY
359 : : )
360 : : ///////////////////////////////////////////////////////////////
361 : : // New properties
362 : : ///////////////////////////////////////////////////////////////
363 [ # # ][ # # ]: 0 : };
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # #
# # # # ]
[ # # ]
364 [ # # ]: 0 : return MAKEPROPSEQUENCE( aRootPropertyInfoTable );
365 [ # # ]: 0 : }
366 : : }
367 : :
368 : : //=========================================================================
369 : : // virtual
370 : 0 : uno::Sequence< ucb::CommandInfo > Content::getCommands(
371 : : const uno::Reference< ucb::XCommandEnvironment > & /*xEnv*/ )
372 : : {
373 [ # # ]: 0 : osl::Guard< osl::Mutex > aGuard( m_aMutex );
374 : :
375 [ # # ]: 0 : if ( m_aProps.getType() == STREAM )
376 : : {
377 : : #ifdef NO_STREAM_CREATION_WITHIN_DOCUMENT_ROOT
378 [ # # ][ # # ]: 0 : Uri aUri( m_xIdentifier->getContentIdentifier() );
379 [ # # ]: 0 : Uri aParentUri( aUri.getParentUri() );
380 : :
381 [ # # ][ # # ]: 0 : if ( aParentUri.isDocument() )
382 : : {
383 : : //=================================================================
384 : : //
385 : : // Stream, that is a child of a document: Supported commands
386 : : //
387 : : //=================================================================
388 : :
389 : : static const ucb::CommandInfo aStreamCommandInfoTable1[] =
390 : : {
391 : : ///////////////////////////////////////////////////////////
392 : : // Mandatory commands
393 : : ///////////////////////////////////////////////////////////
394 : : ucb::CommandInfo(
395 : : rtl::OUString(
396 : : RTL_CONSTASCII_USTRINGPARAM( "getCommandInfo" ) ),
397 : : -1,
398 [ # # ]: 0 : getCppuVoidType()
399 : : ),
400 : : ucb::CommandInfo(
401 : : rtl::OUString(
402 : : RTL_CONSTASCII_USTRINGPARAM( "getPropertySetInfo" ) ),
403 : : -1,
404 [ # # ]: 0 : getCppuVoidType()
405 : : ),
406 : : ucb::CommandInfo(
407 : : rtl::OUString(
408 : : RTL_CONSTASCII_USTRINGPARAM( "getPropertyValues" ) ),
409 : : -1,
410 : : getCppuType(
411 [ # # ]: 0 : static_cast< uno::Sequence< beans::Property > * >( 0 ) )
412 : : ),
413 : : ucb::CommandInfo(
414 : : rtl::OUString(
415 : : RTL_CONSTASCII_USTRINGPARAM( "setPropertyValues" ) ),
416 : : -1,
417 : : getCppuType(
418 : : static_cast<
419 [ # # ]: 0 : uno::Sequence< beans::PropertyValue > * >( 0 ) )
420 : : ),
421 : : ///////////////////////////////////////////////////////////
422 : : // Optional standard commands
423 : : ///////////////////////////////////////////////////////////
424 : : ucb::CommandInfo(
425 : : rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "delete" ) ),
426 : : -1,
427 [ # # ]: 0 : getCppuBooleanType()
428 : : ),
429 : : ucb::CommandInfo(
430 : : rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "open" ) ),
431 : : -1,
432 : : getCppuType(
433 [ # # ]: 0 : static_cast< ucb::OpenCommandArgument2 * >( 0 ) )
434 : : )
435 : : ///////////////////////////////////////////////////////////
436 : : // New commands
437 : : ///////////////////////////////////////////////////////////
438 [ # # ][ # # ]: 0 : };
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # # #
# # ][ # # ]
439 [ # # ]: 0 : return MAKECMDSEQUENCE( aStreamCommandInfoTable1 );
440 : : }
441 : : #endif
442 : : //=================================================================
443 : : //
444 : : // Stream: Supported commands
445 : : //
446 : : //=================================================================
447 : :
448 : : static const ucb::CommandInfo aStreamCommandInfoTable[] =
449 : : {
450 : : ///////////////////////////////////////////////////////////
451 : : // Mandatory commands
452 : : ///////////////////////////////////////////////////////////
453 : : ucb::CommandInfo(
454 : : rtl::OUString(
455 : : RTL_CONSTASCII_USTRINGPARAM( "getCommandInfo" ) ),
456 : : -1,
457 [ # # ]: 0 : getCppuVoidType()
458 : : ),
459 : : ucb::CommandInfo(
460 : : rtl::OUString(
461 : : RTL_CONSTASCII_USTRINGPARAM( "getPropertySetInfo" ) ),
462 : : -1,
463 [ # # ]: 0 : getCppuVoidType()
464 : : ),
465 : : ucb::CommandInfo(
466 : : rtl::OUString(
467 : : RTL_CONSTASCII_USTRINGPARAM( "getPropertyValues" ) ),
468 : : -1,
469 : : getCppuType(
470 [ # # ]: 0 : static_cast< uno::Sequence< beans::Property > * >( 0 ) )
471 : : ),
472 : : ucb::CommandInfo(
473 : : rtl::OUString(
474 : : RTL_CONSTASCII_USTRINGPARAM( "setPropertyValues" ) ),
475 : : -1,
476 : : getCppuType(
477 : : static_cast<
478 [ # # ]: 0 : uno::Sequence< beans::PropertyValue > * >( 0 ) )
479 : : ),
480 : : ///////////////////////////////////////////////////////////
481 : : // Optional standard commands
482 : : ///////////////////////////////////////////////////////////
483 : : ucb::CommandInfo(
484 : : rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "delete" ) ),
485 : : -1,
486 [ # # ]: 0 : getCppuBooleanType()
487 : : ),
488 : : ucb::CommandInfo(
489 : : rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "insert" ) ),
490 : : -1,
491 [ # # ]: 0 : getCppuVoidType()
492 : : ),
493 : : ucb::CommandInfo(
494 : : rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "open" ) ),
495 : : -1,
496 : : getCppuType(
497 [ # # ]: 0 : static_cast< ucb::OpenCommandArgument2 * >( 0 ) )
498 : : )
499 : : ///////////////////////////////////////////////////////////
500 : : // New commands
501 : : ///////////////////////////////////////////////////////////
502 [ # # ][ # # ]: 0 : };
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # #
# # # # ]
[ # # ]
503 [ # # ]: 0 : return MAKECMDSEQUENCE( aStreamCommandInfoTable );
504 : : }
505 [ # # ]: 0 : else if ( m_aProps.getType() == FOLDER )
506 : : {
507 : : //=================================================================
508 : : //
509 : : // Folder: Supported commands
510 : : //
511 : : //=================================================================
512 : :
513 : : static const ucb::CommandInfo aFolderCommandInfoTable[] =
514 : : {
515 : : ///////////////////////////////////////////////////////////
516 : : // Mandatory commands
517 : : ///////////////////////////////////////////////////////////
518 : : ucb::CommandInfo(
519 : : rtl::OUString(
520 : : RTL_CONSTASCII_USTRINGPARAM( "getCommandInfo" ) ),
521 : : -1,
522 [ # # ]: 0 : getCppuVoidType()
523 : : ),
524 : : ucb::CommandInfo(
525 : : rtl::OUString(
526 : : RTL_CONSTASCII_USTRINGPARAM( "getPropertySetInfo" ) ),
527 : : -1,
528 [ # # ]: 0 : getCppuVoidType()
529 : : ),
530 : : ucb::CommandInfo(
531 : : rtl::OUString(
532 : : RTL_CONSTASCII_USTRINGPARAM( "getPropertyValues" ) ),
533 : : -1,
534 : : getCppuType(
535 [ # # ]: 0 : static_cast< uno::Sequence< beans::Property > * >( 0 ) )
536 : : ),
537 : : ucb::CommandInfo(
538 : : rtl::OUString(
539 : : RTL_CONSTASCII_USTRINGPARAM( "setPropertyValues" ) ),
540 : : -1,
541 : : getCppuType(
542 : : static_cast<
543 [ # # ]: 0 : uno::Sequence< beans::PropertyValue > * >( 0 ) )
544 : : ),
545 : : ///////////////////////////////////////////////////////////
546 : : // Optional standard commands
547 : : ///////////////////////////////////////////////////////////
548 : : ucb::CommandInfo(
549 : : rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "delete" ) ),
550 : : -1,
551 [ # # ]: 0 : getCppuBooleanType()
552 : : ),
553 : : ucb::CommandInfo(
554 : : rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "insert" ) ),
555 : : -1,
556 [ # # ]: 0 : getCppuVoidType()
557 : : ),
558 : : ucb::CommandInfo(
559 : : rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "open" ) ),
560 : : -1,
561 : : getCppuType(
562 [ # # ]: 0 : static_cast< ucb::OpenCommandArgument2 * >( 0 ) )
563 : : ),
564 : : ucb::CommandInfo(
565 : : rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "transfer" ) ),
566 : : -1,
567 [ # # ]: 0 : getCppuType( static_cast< ucb::TransferInfo * >( 0 ) )
568 : : ),
569 : : ucb::CommandInfo(
570 : : rtl::OUString(
571 : : RTL_CONSTASCII_USTRINGPARAM( "createNewContent" ) ),
572 : : -1,
573 [ # # ]: 0 : getCppuType( static_cast< ucb::ContentInfo * >( 0 ) )
574 : : )
575 : : ///////////////////////////////////////////////////////////
576 : : // New commands
577 : : ///////////////////////////////////////////////////////////
578 [ # # ][ # # ]: 0 : };
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # #
# # # # ]
[ # # ]
579 [ # # ]: 0 : return MAKECMDSEQUENCE( aFolderCommandInfoTable );
580 : : }
581 [ # # ]: 0 : else if ( m_aProps.getType() == DOCUMENT )
582 : : {
583 : : //=================================================================
584 : : //
585 : : // Document: Supported commands
586 : : //
587 : : //=================================================================
588 : :
589 : : static const ucb::CommandInfo aDocCommandInfoTable[] =
590 : : {
591 : : ///////////////////////////////////////////////////////////
592 : : // Mandatory commands
593 : : ///////////////////////////////////////////////////////////
594 : : ucb::CommandInfo(
595 : : rtl::OUString(
596 : : RTL_CONSTASCII_USTRINGPARAM( "getCommandInfo" ) ),
597 : : -1,
598 [ # # ]: 0 : getCppuVoidType()
599 : : ),
600 : : ucb::CommandInfo(
601 : : rtl::OUString(
602 : : RTL_CONSTASCII_USTRINGPARAM( "getPropertySetInfo" ) ),
603 : : -1,
604 [ # # ]: 0 : getCppuVoidType()
605 : : ),
606 : : ucb::CommandInfo(
607 : : rtl::OUString(
608 : : RTL_CONSTASCII_USTRINGPARAM( "getPropertyValues" ) ),
609 : : -1,
610 : : getCppuType(
611 [ # # ]: 0 : static_cast< uno::Sequence< beans::Property > * >( 0 ) )
612 : : ),
613 : : ucb::CommandInfo(
614 : : rtl::OUString(
615 : : RTL_CONSTASCII_USTRINGPARAM( "setPropertyValues" ) ),
616 : : -1,
617 : : getCppuType(
618 : : static_cast<
619 [ # # ]: 0 : uno::Sequence< beans::PropertyValue > * >( 0 ) )
620 : : ),
621 : : ///////////////////////////////////////////////////////////
622 : : // Optional standard commands
623 : : ///////////////////////////////////////////////////////////
624 : : ucb::CommandInfo(
625 : : rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "open" ) ),
626 : : -1,
627 : : getCppuType(
628 [ # # ]: 0 : static_cast< ucb::OpenCommandArgument2 * >( 0 ) )
629 : : ),
630 : : ucb::CommandInfo(
631 : : rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "transfer" ) ),
632 : : -1,
633 [ # # ]: 0 : getCppuType( static_cast< ucb::TransferInfo * >( 0 ) )
634 : : ),
635 : : ucb::CommandInfo(
636 : : rtl::OUString(
637 : : RTL_CONSTASCII_USTRINGPARAM( "createNewContent" ) ),
638 : : -1,
639 [ # # ]: 0 : getCppuType( static_cast< ucb::ContentInfo * >( 0 ) )
640 : : )
641 : : ///////////////////////////////////////////////////////////
642 : : // New commands
643 : : ///////////////////////////////////////////////////////////
644 [ # # ][ # # ]: 0 : };
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # #
# # # # ]
[ # # ]
645 [ # # ]: 0 : return MAKECMDSEQUENCE( aDocCommandInfoTable );
646 : : }
647 : : else
648 : : {
649 : : //=================================================================
650 : : //
651 : : // Root: Supported commands
652 : : //
653 : : //=================================================================
654 : :
655 : : OSL_ENSURE( m_aProps.getType() == ROOT, "Wrong content type!" );
656 : :
657 : : static const ucb::CommandInfo aRootCommandInfoTable[] =
658 : : {
659 : : ///////////////////////////////////////////////////////////
660 : : // Mandatory commands
661 : : ///////////////////////////////////////////////////////////
662 : : ucb::CommandInfo(
663 : : rtl::OUString(
664 : : RTL_CONSTASCII_USTRINGPARAM( "getCommandInfo" ) ),
665 : : -1,
666 [ # # ]: 0 : getCppuVoidType()
667 : : ),
668 : : ucb::CommandInfo(
669 : : rtl::OUString(
670 : : RTL_CONSTASCII_USTRINGPARAM( "getPropertySetInfo" ) ),
671 : : -1,
672 [ # # ]: 0 : getCppuVoidType()
673 : : ),
674 : : ucb::CommandInfo(
675 : : rtl::OUString(
676 : : RTL_CONSTASCII_USTRINGPARAM( "getPropertyValues" ) ),
677 : : -1,
678 : : getCppuType(
679 [ # # ]: 0 : static_cast< uno::Sequence< beans::Property > * >( 0 ) )
680 : : ),
681 : : ucb::CommandInfo(
682 : : rtl::OUString(
683 : : RTL_CONSTASCII_USTRINGPARAM( "setPropertyValues" ) ),
684 : : -1,
685 : : getCppuType(
686 : : static_cast<
687 [ # # ]: 0 : uno::Sequence< beans::PropertyValue > * >( 0 ) )
688 : : ),
689 : : ///////////////////////////////////////////////////////////
690 : : // Optional standard commands
691 : : ///////////////////////////////////////////////////////////
692 : : ucb::CommandInfo(
693 : : rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "open" ) ),
694 : : -1,
695 : : getCppuType(
696 [ # # ]: 0 : static_cast< ucb::OpenCommandArgument2 * >( 0 ) )
697 : : )
698 : : ///////////////////////////////////////////////////////////
699 : : // New commands
700 : : ///////////////////////////////////////////////////////////
701 [ # # ][ # # ]: 0 : };
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # #
# # # # ]
[ # # ]
702 [ # # ]: 0 : return MAKECMDSEQUENCE( aRootCommandInfoTable );
703 [ # # ]: 0 : }
704 : : }
705 : :
706 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|