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 ************************************************************************** 32cdf0e10cSrcweir 33cdf0e10cSrcweir Props/Commands: 34cdf0e10cSrcweir 35cdf0e10cSrcweir root folder folder link link 36cdf0e10cSrcweir (new) (new) 37cdf0e10cSrcweir ---------------------------------------------------------------- 38cdf0e10cSrcweir ContentType x x x x x 39cdf0e10cSrcweir IsDocument x x x x x 40cdf0e10cSrcweir IsFolder x x x x x 41cdf0e10cSrcweir Title x x x x x 42cdf0e10cSrcweir TargetURL x x 43cdf0e10cSrcweir CreatableContentsInfo x x x x x 44cdf0e10cSrcweir 45cdf0e10cSrcweir getCommandInfo x x x x x 46cdf0e10cSrcweir getPropertySetInfo x x x x x 47cdf0e10cSrcweir getPropertyValues x x x x x 48cdf0e10cSrcweir setPropertyValues x x x x x 49cdf0e10cSrcweir createNewContent x x 50cdf0e10cSrcweir insert x x 51cdf0e10cSrcweir delete x x 52cdf0e10cSrcweir open x x 53cdf0e10cSrcweir transfer x x 54cdf0e10cSrcweir 55cdf0e10cSrcweir *************************************************************************/ 56cdf0e10cSrcweir 57cdf0e10cSrcweir #include <com/sun/star/beans/Property.hpp> 58cdf0e10cSrcweir #include <com/sun/star/beans/PropertyAttribute.hpp> 59cdf0e10cSrcweir #include <com/sun/star/beans/PropertyValue.hpp> 60cdf0e10cSrcweir #include <com/sun/star/ucb/CommandInfo.hpp> 61cdf0e10cSrcweir #include <com/sun/star/ucb/OpenCommandArgument2.hpp> 62cdf0e10cSrcweir #include <com/sun/star/ucb/TransferInfo.hpp> 63cdf0e10cSrcweir #include <com/sun/star/uno/Sequence.hxx> 64cdf0e10cSrcweir #include "hierarchycontent.hxx" 65cdf0e10cSrcweir 66cdf0e10cSrcweir using namespace com::sun::star; 67cdf0e10cSrcweir using namespace hierarchy_ucp; 68cdf0e10cSrcweir 69cdf0e10cSrcweir //========================================================================= 70cdf0e10cSrcweir // 71cdf0e10cSrcweir // HierarchyContent implementation. 72cdf0e10cSrcweir // 73cdf0e10cSrcweir //========================================================================= 74cdf0e10cSrcweir 75cdf0e10cSrcweir #define MAKEPROPSEQUENCE( a ) \ 76cdf0e10cSrcweir uno::Sequence< beans::Property >( a, sizeof( a ) / sizeof( a[ 0 ] ) ) 77cdf0e10cSrcweir 78cdf0e10cSrcweir #define MAKECMDSEQUENCE( a ) \ 79cdf0e10cSrcweir uno::Sequence< ucb::CommandInfo >( a, sizeof( a ) / sizeof( a[ 0 ] ) ) 80cdf0e10cSrcweir 81cdf0e10cSrcweir //========================================================================= 82cdf0e10cSrcweir // 83cdf0e10cSrcweir // IMPORTENT: If any property data ( name / type / ... ) are changed, then 84cdf0e10cSrcweir // HierarchyContent::getPropertyValues(...) must be adapted too! 85cdf0e10cSrcweir // 86cdf0e10cSrcweir //========================================================================= 87cdf0e10cSrcweir 88cdf0e10cSrcweir // virtual 89cdf0e10cSrcweir uno::Sequence< beans::Property > HierarchyContent::getProperties( 90cdf0e10cSrcweir const uno::Reference< ucb::XCommandEnvironment > & /*xEnv*/ ) 91cdf0e10cSrcweir { 92cdf0e10cSrcweir osl::Guard< osl::Mutex > aGuard( m_aMutex ); 93cdf0e10cSrcweir 94cdf0e10cSrcweir if ( m_eKind == LINK ) 95cdf0e10cSrcweir { 96cdf0e10cSrcweir //================================================================= 97cdf0e10cSrcweir // 98cdf0e10cSrcweir // Link: Supported properties 99cdf0e10cSrcweir // 100cdf0e10cSrcweir //================================================================= 101cdf0e10cSrcweir 102cdf0e10cSrcweir if ( isReadOnly() ) 103cdf0e10cSrcweir { 104cdf0e10cSrcweir static beans::Property aLinkPropertyInfoTable[] = 105cdf0e10cSrcweir { 106cdf0e10cSrcweir /////////////////////////////////////////////////////////// 107cdf0e10cSrcweir // Required properties 108cdf0e10cSrcweir /////////////////////////////////////////////////////////// 109cdf0e10cSrcweir beans::Property( 110cdf0e10cSrcweir rtl::OUString( 111cdf0e10cSrcweir RTL_CONSTASCII_USTRINGPARAM( "ContentType" ) ), 112cdf0e10cSrcweir -1, 113cdf0e10cSrcweir getCppuType( static_cast< const rtl::OUString * >( 0 ) ), 114cdf0e10cSrcweir beans::PropertyAttribute::BOUND 115cdf0e10cSrcweir | beans::PropertyAttribute::READONLY 116cdf0e10cSrcweir ), 117cdf0e10cSrcweir beans::Property( 118cdf0e10cSrcweir rtl::OUString( 119cdf0e10cSrcweir RTL_CONSTASCII_USTRINGPARAM( "IsDocument" ) ), 120cdf0e10cSrcweir -1, 121cdf0e10cSrcweir getCppuBooleanType(), 122cdf0e10cSrcweir beans::PropertyAttribute::BOUND 123cdf0e10cSrcweir | beans::PropertyAttribute::READONLY 124cdf0e10cSrcweir ), 125cdf0e10cSrcweir beans::Property( 126cdf0e10cSrcweir rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "IsFolder" ) ), 127cdf0e10cSrcweir -1, 128cdf0e10cSrcweir getCppuBooleanType(), 129cdf0e10cSrcweir beans::PropertyAttribute::BOUND 130cdf0e10cSrcweir | beans::PropertyAttribute::READONLY 131cdf0e10cSrcweir ), 132cdf0e10cSrcweir beans::Property( 133cdf0e10cSrcweir rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Title" ) ), 134cdf0e10cSrcweir -1, 135cdf0e10cSrcweir getCppuType( static_cast< const rtl::OUString * >( 0 ) ), 136cdf0e10cSrcweir beans::PropertyAttribute::BOUND 137cdf0e10cSrcweir | beans::PropertyAttribute::READONLY 138cdf0e10cSrcweir ), 139cdf0e10cSrcweir /////////////////////////////////////////////////////////// 140cdf0e10cSrcweir // Optional standard properties 141cdf0e10cSrcweir /////////////////////////////////////////////////////////// 142cdf0e10cSrcweir beans::Property( 143cdf0e10cSrcweir rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "TargetURL" ) ), 144cdf0e10cSrcweir -1, 145cdf0e10cSrcweir getCppuType( static_cast< const rtl::OUString * >( 0 ) ), 146cdf0e10cSrcweir beans::PropertyAttribute::BOUND 147cdf0e10cSrcweir | beans::PropertyAttribute::READONLY 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 // New properties 159cdf0e10cSrcweir /////////////////////////////////////////////////////////// 160cdf0e10cSrcweir }; 161cdf0e10cSrcweir return MAKEPROPSEQUENCE( aLinkPropertyInfoTable ); 162cdf0e10cSrcweir } 163cdf0e10cSrcweir else 164cdf0e10cSrcweir { 165cdf0e10cSrcweir static beans::Property aLinkPropertyInfoTable[] = 166cdf0e10cSrcweir { 167cdf0e10cSrcweir /////////////////////////////////////////////////////////// 168cdf0e10cSrcweir // Required properties 169cdf0e10cSrcweir /////////////////////////////////////////////////////////// 170cdf0e10cSrcweir beans::Property( 171cdf0e10cSrcweir rtl::OUString( 172cdf0e10cSrcweir RTL_CONSTASCII_USTRINGPARAM( "ContentType" ) ), 173cdf0e10cSrcweir -1, 174cdf0e10cSrcweir getCppuType( static_cast< const rtl::OUString * >( 0 ) ), 175cdf0e10cSrcweir beans::PropertyAttribute::BOUND 176cdf0e10cSrcweir | beans::PropertyAttribute::READONLY 177cdf0e10cSrcweir ), 178cdf0e10cSrcweir beans::Property( 179cdf0e10cSrcweir rtl::OUString( 180cdf0e10cSrcweir RTL_CONSTASCII_USTRINGPARAM( "IsDocument" ) ), 181cdf0e10cSrcweir -1, 182cdf0e10cSrcweir getCppuBooleanType(), 183cdf0e10cSrcweir beans::PropertyAttribute::BOUND 184cdf0e10cSrcweir | beans::PropertyAttribute::READONLY 185cdf0e10cSrcweir ), 186cdf0e10cSrcweir beans::Property( 187cdf0e10cSrcweir rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "IsFolder" ) ), 188cdf0e10cSrcweir -1, 189cdf0e10cSrcweir getCppuBooleanType(), 190cdf0e10cSrcweir beans::PropertyAttribute::BOUND 191cdf0e10cSrcweir | beans::PropertyAttribute::READONLY 192cdf0e10cSrcweir ), 193cdf0e10cSrcweir beans::Property( 194cdf0e10cSrcweir rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Title" ) ), 195cdf0e10cSrcweir -1, 196cdf0e10cSrcweir getCppuType( static_cast< const rtl::OUString * >( 0 ) ), 197cdf0e10cSrcweir beans::PropertyAttribute::BOUND 198cdf0e10cSrcweir ), 199cdf0e10cSrcweir /////////////////////////////////////////////////////////// 200cdf0e10cSrcweir // Optional standard properties 201cdf0e10cSrcweir /////////////////////////////////////////////////////////// 202cdf0e10cSrcweir beans::Property( 203cdf0e10cSrcweir rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "TargetURL" ) ), 204cdf0e10cSrcweir -1, 205cdf0e10cSrcweir getCppuType( static_cast< const rtl::OUString * >( 0 ) ), 206cdf0e10cSrcweir beans::PropertyAttribute::BOUND 207cdf0e10cSrcweir ), 208cdf0e10cSrcweir beans::Property( 209cdf0e10cSrcweir rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( 210cdf0e10cSrcweir "CreatableContentsInfo" ) ), 211cdf0e10cSrcweir -1, 212cdf0e10cSrcweir getCppuType( static_cast< 213cdf0e10cSrcweir const uno::Sequence< ucb::ContentInfo > * >( 0 ) ), 214cdf0e10cSrcweir beans::PropertyAttribute::BOUND 215cdf0e10cSrcweir | beans::PropertyAttribute::READONLY ) 216cdf0e10cSrcweir /////////////////////////////////////////////////////////// 217cdf0e10cSrcweir // New properties 218cdf0e10cSrcweir /////////////////////////////////////////////////////////// 219cdf0e10cSrcweir }; 220cdf0e10cSrcweir return MAKEPROPSEQUENCE( aLinkPropertyInfoTable ); 221cdf0e10cSrcweir } 222cdf0e10cSrcweir } 223cdf0e10cSrcweir else if ( m_eKind == FOLDER ) 224cdf0e10cSrcweir { 225cdf0e10cSrcweir //================================================================= 226cdf0e10cSrcweir // 227cdf0e10cSrcweir // Folder: Supported properties 228cdf0e10cSrcweir // 229cdf0e10cSrcweir //================================================================= 230cdf0e10cSrcweir 231cdf0e10cSrcweir if ( isReadOnly() ) 232cdf0e10cSrcweir { 233cdf0e10cSrcweir static beans::Property aFolderPropertyInfoTable[] = 234cdf0e10cSrcweir { 235cdf0e10cSrcweir /////////////////////////////////////////////////////////// 236cdf0e10cSrcweir // Required properties 237cdf0e10cSrcweir /////////////////////////////////////////////////////////// 238cdf0e10cSrcweir beans::Property( 239cdf0e10cSrcweir rtl::OUString( 240cdf0e10cSrcweir RTL_CONSTASCII_USTRINGPARAM( "ContentType" ) ), 241cdf0e10cSrcweir -1, 242cdf0e10cSrcweir getCppuType( static_cast< const rtl::OUString * >( 0 ) ), 243cdf0e10cSrcweir beans::PropertyAttribute::BOUND 244cdf0e10cSrcweir | beans::PropertyAttribute::READONLY 245cdf0e10cSrcweir ), 246cdf0e10cSrcweir beans::Property( 247cdf0e10cSrcweir rtl::OUString( 248cdf0e10cSrcweir RTL_CONSTASCII_USTRINGPARAM( "IsDocument" ) ), 249cdf0e10cSrcweir -1, 250cdf0e10cSrcweir getCppuBooleanType(), 251cdf0e10cSrcweir beans::PropertyAttribute::BOUND 252cdf0e10cSrcweir | beans::PropertyAttribute::READONLY 253cdf0e10cSrcweir ), 254cdf0e10cSrcweir beans::Property( 255cdf0e10cSrcweir rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "IsFolder" ) ), 256cdf0e10cSrcweir -1, 257cdf0e10cSrcweir getCppuBooleanType(), 258cdf0e10cSrcweir beans::PropertyAttribute::BOUND 259cdf0e10cSrcweir | beans::PropertyAttribute::READONLY 260cdf0e10cSrcweir ), 261cdf0e10cSrcweir beans::Property( 262cdf0e10cSrcweir rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Title" ) ), 263cdf0e10cSrcweir -1, 264cdf0e10cSrcweir getCppuType( static_cast< const rtl::OUString * >( 0 ) ), 265cdf0e10cSrcweir beans::PropertyAttribute::BOUND 266cdf0e10cSrcweir | beans::PropertyAttribute::READONLY 267cdf0e10cSrcweir ), 268cdf0e10cSrcweir /////////////////////////////////////////////////////////// 269cdf0e10cSrcweir // Optional standard properties 270cdf0e10cSrcweir /////////////////////////////////////////////////////////// 271cdf0e10cSrcweir beans::Property( 272cdf0e10cSrcweir rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( 273cdf0e10cSrcweir "CreatableContentsInfo" ) ), 274cdf0e10cSrcweir -1, 275cdf0e10cSrcweir getCppuType( static_cast< 276cdf0e10cSrcweir const uno::Sequence< ucb::ContentInfo > * >( 0 ) ), 277cdf0e10cSrcweir beans::PropertyAttribute::BOUND 278cdf0e10cSrcweir | beans::PropertyAttribute::READONLY ) 279cdf0e10cSrcweir /////////////////////////////////////////////////////////// 280cdf0e10cSrcweir // New properties 281cdf0e10cSrcweir /////////////////////////////////////////////////////////// 282cdf0e10cSrcweir }; 283cdf0e10cSrcweir return MAKEPROPSEQUENCE( aFolderPropertyInfoTable ); 284cdf0e10cSrcweir } 285cdf0e10cSrcweir else 286cdf0e10cSrcweir { 287cdf0e10cSrcweir static beans::Property aFolderPropertyInfoTable[] = 288cdf0e10cSrcweir { 289cdf0e10cSrcweir /////////////////////////////////////////////////////////// 290cdf0e10cSrcweir // Required properties 291cdf0e10cSrcweir /////////////////////////////////////////////////////////// 292cdf0e10cSrcweir beans::Property( 293cdf0e10cSrcweir rtl::OUString( 294cdf0e10cSrcweir RTL_CONSTASCII_USTRINGPARAM( "ContentType" ) ), 295cdf0e10cSrcweir -1, 296cdf0e10cSrcweir getCppuType( static_cast< const rtl::OUString * >( 0 ) ), 297cdf0e10cSrcweir beans::PropertyAttribute::BOUND 298cdf0e10cSrcweir | beans::PropertyAttribute::READONLY 299cdf0e10cSrcweir ), 300cdf0e10cSrcweir beans::Property( 301cdf0e10cSrcweir rtl::OUString( 302cdf0e10cSrcweir RTL_CONSTASCII_USTRINGPARAM( "IsDocument" ) ), 303cdf0e10cSrcweir -1, 304cdf0e10cSrcweir getCppuBooleanType(), 305cdf0e10cSrcweir beans::PropertyAttribute::BOUND 306cdf0e10cSrcweir | beans::PropertyAttribute::READONLY 307cdf0e10cSrcweir ), 308cdf0e10cSrcweir beans::Property( 309cdf0e10cSrcweir rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "IsFolder" ) ), 310cdf0e10cSrcweir -1, 311cdf0e10cSrcweir getCppuBooleanType(), 312cdf0e10cSrcweir beans::PropertyAttribute::BOUND 313cdf0e10cSrcweir | beans::PropertyAttribute::READONLY 314cdf0e10cSrcweir ), 315cdf0e10cSrcweir beans::Property( 316cdf0e10cSrcweir rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Title" ) ), 317cdf0e10cSrcweir -1, 318cdf0e10cSrcweir getCppuType( static_cast< const rtl::OUString * >( 0 ) ), 319cdf0e10cSrcweir beans::PropertyAttribute::BOUND 320cdf0e10cSrcweir ), 321cdf0e10cSrcweir /////////////////////////////////////////////////////////// 322cdf0e10cSrcweir // Optional standard properties 323cdf0e10cSrcweir /////////////////////////////////////////////////////////// 324cdf0e10cSrcweir beans::Property( 325cdf0e10cSrcweir rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( 326cdf0e10cSrcweir "CreatableContentsInfo" ) ), 327cdf0e10cSrcweir -1, 328cdf0e10cSrcweir getCppuType( static_cast< 329cdf0e10cSrcweir const uno::Sequence< ucb::ContentInfo > * >( 0 ) ), 330cdf0e10cSrcweir beans::PropertyAttribute::BOUND 331cdf0e10cSrcweir | beans::PropertyAttribute::READONLY ) 332cdf0e10cSrcweir /////////////////////////////////////////////////////////// 333cdf0e10cSrcweir // New properties 334cdf0e10cSrcweir /////////////////////////////////////////////////////////// 335cdf0e10cSrcweir }; 336cdf0e10cSrcweir return MAKEPROPSEQUENCE( aFolderPropertyInfoTable ); 337cdf0e10cSrcweir } 338cdf0e10cSrcweir } 339cdf0e10cSrcweir else 340cdf0e10cSrcweir { 341cdf0e10cSrcweir //================================================================= 342cdf0e10cSrcweir // 343cdf0e10cSrcweir // Root Folder: Supported properties 344cdf0e10cSrcweir // 345cdf0e10cSrcweir //================================================================= 346cdf0e10cSrcweir 347cdf0e10cSrcweir // Currently no difference between reonly /read-write 348cdf0e10cSrcweir // -> all props ar read-only 349cdf0e10cSrcweir 350cdf0e10cSrcweir static beans::Property aRootFolderPropertyInfoTable[] = 351cdf0e10cSrcweir { 352cdf0e10cSrcweir /////////////////////////////////////////////////////////////// 353cdf0e10cSrcweir // Required properties 354cdf0e10cSrcweir /////////////////////////////////////////////////////////////// 355cdf0e10cSrcweir beans::Property( 356cdf0e10cSrcweir rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ContentType" ) ), 357cdf0e10cSrcweir -1, 358cdf0e10cSrcweir getCppuType( static_cast< const rtl::OUString * >( 0 ) ), 359cdf0e10cSrcweir beans::PropertyAttribute::BOUND 360cdf0e10cSrcweir | beans::PropertyAttribute::READONLY 361cdf0e10cSrcweir ), 362cdf0e10cSrcweir beans::Property( 363cdf0e10cSrcweir rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "IsDocument" ) ), 364cdf0e10cSrcweir -1, 365cdf0e10cSrcweir getCppuBooleanType(), 366cdf0e10cSrcweir beans::PropertyAttribute::BOUND 367cdf0e10cSrcweir | beans::PropertyAttribute::READONLY 368cdf0e10cSrcweir ), 369cdf0e10cSrcweir beans::Property( 370cdf0e10cSrcweir rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "IsFolder" ) ), 371cdf0e10cSrcweir -1, 372cdf0e10cSrcweir getCppuBooleanType(), 373cdf0e10cSrcweir beans::PropertyAttribute::BOUND 374cdf0e10cSrcweir | beans::PropertyAttribute::READONLY 375cdf0e10cSrcweir ), 376cdf0e10cSrcweir beans::Property( 377cdf0e10cSrcweir rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Title" ) ), 378cdf0e10cSrcweir -1, 379cdf0e10cSrcweir getCppuType( static_cast< const rtl::OUString * >( 0 ) ), 380cdf0e10cSrcweir beans::PropertyAttribute::BOUND 381cdf0e10cSrcweir | beans::PropertyAttribute::READONLY 382cdf0e10cSrcweir ), 383cdf0e10cSrcweir /////////////////////////////////////////////////////////////// 384cdf0e10cSrcweir // Optional standard properties 385cdf0e10cSrcweir /////////////////////////////////////////////////////////////// 386cdf0e10cSrcweir beans::Property( 387cdf0e10cSrcweir rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( 388cdf0e10cSrcweir "CreatableContentsInfo" ) ), 389cdf0e10cSrcweir -1, 390cdf0e10cSrcweir getCppuType( static_cast< 391cdf0e10cSrcweir const uno::Sequence< ucb::ContentInfo > * >( 0 ) ), 392cdf0e10cSrcweir beans::PropertyAttribute::BOUND 393cdf0e10cSrcweir | beans::PropertyAttribute::READONLY ) 394cdf0e10cSrcweir /////////////////////////////////////////////////////////////// 395cdf0e10cSrcweir // New properties 396cdf0e10cSrcweir /////////////////////////////////////////////////////////////// 397cdf0e10cSrcweir }; 398cdf0e10cSrcweir return MAKEPROPSEQUENCE( aRootFolderPropertyInfoTable ); 399cdf0e10cSrcweir } 400cdf0e10cSrcweir } 401cdf0e10cSrcweir 402cdf0e10cSrcweir //========================================================================= 403cdf0e10cSrcweir // virtual 404cdf0e10cSrcweir uno::Sequence< ucb::CommandInfo > HierarchyContent::getCommands( 405cdf0e10cSrcweir const uno::Reference< ucb::XCommandEnvironment > & /*xEnv*/ ) 406cdf0e10cSrcweir { 407cdf0e10cSrcweir osl::Guard< osl::Mutex > aGuard( m_aMutex ); 408cdf0e10cSrcweir 409cdf0e10cSrcweir if ( m_eKind == LINK ) 410cdf0e10cSrcweir { 411cdf0e10cSrcweir //================================================================= 412cdf0e10cSrcweir // 413cdf0e10cSrcweir // Link: Supported commands 414cdf0e10cSrcweir // 415cdf0e10cSrcweir //================================================================= 416cdf0e10cSrcweir 417cdf0e10cSrcweir if ( isReadOnly() ) 418cdf0e10cSrcweir { 419cdf0e10cSrcweir static const ucb::CommandInfo aLinkCommandInfoTable[] = 420cdf0e10cSrcweir { 421cdf0e10cSrcweir /////////////////////////////////////////////////////////// 422cdf0e10cSrcweir // Required commands 423cdf0e10cSrcweir /////////////////////////////////////////////////////////// 424cdf0e10cSrcweir ucb::CommandInfo( 425cdf0e10cSrcweir rtl::OUString( 426cdf0e10cSrcweir RTL_CONSTASCII_USTRINGPARAM( "getCommandInfo" ) ), 427cdf0e10cSrcweir -1, 428cdf0e10cSrcweir getCppuVoidType() 429cdf0e10cSrcweir ), 430cdf0e10cSrcweir ucb::CommandInfo( 431cdf0e10cSrcweir rtl::OUString( 432cdf0e10cSrcweir RTL_CONSTASCII_USTRINGPARAM( "getPropertySetInfo" ) ), 433cdf0e10cSrcweir -1, 434cdf0e10cSrcweir getCppuVoidType() 435cdf0e10cSrcweir ), 436cdf0e10cSrcweir ucb::CommandInfo( 437cdf0e10cSrcweir rtl::OUString( 438cdf0e10cSrcweir RTL_CONSTASCII_USTRINGPARAM( "getPropertyValues" ) ), 439cdf0e10cSrcweir -1, 440cdf0e10cSrcweir getCppuType( 441cdf0e10cSrcweir static_cast< uno::Sequence< beans::Property > * >( 0 ) ) 442cdf0e10cSrcweir ), 443cdf0e10cSrcweir ucb::CommandInfo( 444cdf0e10cSrcweir rtl::OUString( 445cdf0e10cSrcweir RTL_CONSTASCII_USTRINGPARAM( "setPropertyValues" ) ), 446cdf0e10cSrcweir -1, 447cdf0e10cSrcweir getCppuType( 448cdf0e10cSrcweir static_cast< 449cdf0e10cSrcweir uno::Sequence< beans::PropertyValue > * >( 0 ) ) 450cdf0e10cSrcweir ) 451cdf0e10cSrcweir /////////////////////////////////////////////////////////// 452cdf0e10cSrcweir // Optional standard commands 453cdf0e10cSrcweir /////////////////////////////////////////////////////////// 454cdf0e10cSrcweir 455cdf0e10cSrcweir /////////////////////////////////////////////////////////// 456cdf0e10cSrcweir // New commands 457cdf0e10cSrcweir /////////////////////////////////////////////////////////// 458cdf0e10cSrcweir }; 459cdf0e10cSrcweir return MAKECMDSEQUENCE( aLinkCommandInfoTable ); 460cdf0e10cSrcweir } 461cdf0e10cSrcweir else 462cdf0e10cSrcweir { 463cdf0e10cSrcweir static const ucb::CommandInfo aLinkCommandInfoTable[] = 464cdf0e10cSrcweir { 465cdf0e10cSrcweir /////////////////////////////////////////////////////////// 466cdf0e10cSrcweir // Required commands 467cdf0e10cSrcweir /////////////////////////////////////////////////////////// 468cdf0e10cSrcweir ucb::CommandInfo( 469cdf0e10cSrcweir rtl::OUString( 470cdf0e10cSrcweir RTL_CONSTASCII_USTRINGPARAM( "getCommandInfo" ) ), 471cdf0e10cSrcweir -1, 472cdf0e10cSrcweir getCppuVoidType() 473cdf0e10cSrcweir ), 474cdf0e10cSrcweir ucb::CommandInfo( 475cdf0e10cSrcweir rtl::OUString( 476cdf0e10cSrcweir RTL_CONSTASCII_USTRINGPARAM( "getPropertySetInfo" ) ), 477cdf0e10cSrcweir -1, 478cdf0e10cSrcweir getCppuVoidType() 479cdf0e10cSrcweir ), 480cdf0e10cSrcweir ucb::CommandInfo( 481cdf0e10cSrcweir rtl::OUString( 482cdf0e10cSrcweir RTL_CONSTASCII_USTRINGPARAM( "getPropertyValues" ) ), 483cdf0e10cSrcweir -1, 484cdf0e10cSrcweir getCppuType( 485cdf0e10cSrcweir static_cast< uno::Sequence< beans::Property > * >( 0 ) ) 486cdf0e10cSrcweir ), 487cdf0e10cSrcweir ucb::CommandInfo( 488cdf0e10cSrcweir rtl::OUString( 489cdf0e10cSrcweir RTL_CONSTASCII_USTRINGPARAM( "setPropertyValues" ) ), 490cdf0e10cSrcweir -1, 491cdf0e10cSrcweir getCppuType( 492cdf0e10cSrcweir static_cast< 493cdf0e10cSrcweir uno::Sequence< beans::PropertyValue > * >( 0 ) ) 494cdf0e10cSrcweir ), 495cdf0e10cSrcweir /////////////////////////////////////////////////////////// 496cdf0e10cSrcweir // Optional standard commands 497cdf0e10cSrcweir /////////////////////////////////////////////////////////// 498cdf0e10cSrcweir ucb::CommandInfo( 499cdf0e10cSrcweir rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "delete" ) ), 500cdf0e10cSrcweir -1, 501cdf0e10cSrcweir getCppuBooleanType() 502cdf0e10cSrcweir ), 503cdf0e10cSrcweir ucb::CommandInfo( 504cdf0e10cSrcweir rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "insert" ) ), 505cdf0e10cSrcweir -1, 506cdf0e10cSrcweir getCppuVoidType() 507cdf0e10cSrcweir ) 508cdf0e10cSrcweir /////////////////////////////////////////////////////////// 509cdf0e10cSrcweir // New commands 510cdf0e10cSrcweir /////////////////////////////////////////////////////////// 511cdf0e10cSrcweir }; 512cdf0e10cSrcweir return MAKECMDSEQUENCE( aLinkCommandInfoTable ); 513cdf0e10cSrcweir } 514cdf0e10cSrcweir } 515cdf0e10cSrcweir else if ( m_eKind == FOLDER ) 516cdf0e10cSrcweir { 517cdf0e10cSrcweir //================================================================= 518cdf0e10cSrcweir // 519cdf0e10cSrcweir // Folder: Supported commands 520cdf0e10cSrcweir // 521cdf0e10cSrcweir //================================================================= 522cdf0e10cSrcweir 523cdf0e10cSrcweir if ( isReadOnly() ) 524cdf0e10cSrcweir { 525cdf0e10cSrcweir static const ucb::CommandInfo aFolderCommandInfoTable[] = 526cdf0e10cSrcweir { 527cdf0e10cSrcweir /////////////////////////////////////////////////////////// 528cdf0e10cSrcweir // Required commands 529cdf0e10cSrcweir /////////////////////////////////////////////////////////// 530cdf0e10cSrcweir ucb::CommandInfo( 531cdf0e10cSrcweir rtl::OUString( 532cdf0e10cSrcweir RTL_CONSTASCII_USTRINGPARAM( "getCommandInfo" ) ), 533cdf0e10cSrcweir -1, 534cdf0e10cSrcweir getCppuVoidType() 535cdf0e10cSrcweir ), 536cdf0e10cSrcweir ucb::CommandInfo( 537cdf0e10cSrcweir rtl::OUString( 538cdf0e10cSrcweir RTL_CONSTASCII_USTRINGPARAM( "getPropertySetInfo" ) ), 539cdf0e10cSrcweir -1, 540cdf0e10cSrcweir getCppuVoidType() 541cdf0e10cSrcweir ), 542cdf0e10cSrcweir ucb::CommandInfo( 543cdf0e10cSrcweir rtl::OUString( 544cdf0e10cSrcweir RTL_CONSTASCII_USTRINGPARAM( "getPropertyValues" ) ), 545cdf0e10cSrcweir -1, 546cdf0e10cSrcweir getCppuType( 547cdf0e10cSrcweir static_cast< uno::Sequence< beans::Property > * >( 0 ) ) 548cdf0e10cSrcweir ), 549cdf0e10cSrcweir ucb::CommandInfo( 550cdf0e10cSrcweir rtl::OUString( 551cdf0e10cSrcweir RTL_CONSTASCII_USTRINGPARAM( "setPropertyValues" ) ), 552cdf0e10cSrcweir -1, 553cdf0e10cSrcweir getCppuType( 554cdf0e10cSrcweir static_cast< 555cdf0e10cSrcweir uno::Sequence< beans::PropertyValue > * >( 0 ) ) 556cdf0e10cSrcweir ), 557cdf0e10cSrcweir /////////////////////////////////////////////////////////// 558cdf0e10cSrcweir // Optional standard commands 559cdf0e10cSrcweir /////////////////////////////////////////////////////////// 560cdf0e10cSrcweir ucb::CommandInfo( 561cdf0e10cSrcweir rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "open" ) ), 562cdf0e10cSrcweir -1, 563cdf0e10cSrcweir getCppuType( 564cdf0e10cSrcweir static_cast< ucb::OpenCommandArgument2 * >( 0 ) ) 565cdf0e10cSrcweir ) 566cdf0e10cSrcweir /////////////////////////////////////////////////////////// 567cdf0e10cSrcweir // New commands 568cdf0e10cSrcweir /////////////////////////////////////////////////////////// 569cdf0e10cSrcweir }; 570cdf0e10cSrcweir return MAKECMDSEQUENCE( aFolderCommandInfoTable ); 571cdf0e10cSrcweir } 572cdf0e10cSrcweir else 573cdf0e10cSrcweir { 574cdf0e10cSrcweir static const ucb::CommandInfo aFolderCommandInfoTable[] = 575cdf0e10cSrcweir { 576cdf0e10cSrcweir /////////////////////////////////////////////////////////// 577cdf0e10cSrcweir // Required commands 578cdf0e10cSrcweir /////////////////////////////////////////////////////////// 579cdf0e10cSrcweir ucb::CommandInfo( 580cdf0e10cSrcweir rtl::OUString( 581cdf0e10cSrcweir RTL_CONSTASCII_USTRINGPARAM( "getCommandInfo" ) ), 582cdf0e10cSrcweir -1, 583cdf0e10cSrcweir getCppuVoidType() 584cdf0e10cSrcweir ), 585cdf0e10cSrcweir ucb::CommandInfo( 586cdf0e10cSrcweir rtl::OUString( 587cdf0e10cSrcweir RTL_CONSTASCII_USTRINGPARAM( "getPropertySetInfo" ) ), 588cdf0e10cSrcweir -1, 589cdf0e10cSrcweir getCppuVoidType() 590cdf0e10cSrcweir ), 591cdf0e10cSrcweir ucb::CommandInfo( 592cdf0e10cSrcweir rtl::OUString( 593cdf0e10cSrcweir RTL_CONSTASCII_USTRINGPARAM( "getPropertyValues" ) ), 594cdf0e10cSrcweir -1, 595cdf0e10cSrcweir getCppuType( 596cdf0e10cSrcweir static_cast< uno::Sequence< beans::Property > * >( 0 ) ) 597cdf0e10cSrcweir ), 598cdf0e10cSrcweir ucb::CommandInfo( 599cdf0e10cSrcweir rtl::OUString( 600cdf0e10cSrcweir RTL_CONSTASCII_USTRINGPARAM( "setPropertyValues" ) ), 601cdf0e10cSrcweir -1, 602cdf0e10cSrcweir getCppuType( 603cdf0e10cSrcweir static_cast< 604cdf0e10cSrcweir uno::Sequence< beans::PropertyValue > * >( 0 ) ) 605cdf0e10cSrcweir ), 606cdf0e10cSrcweir /////////////////////////////////////////////////////////// 607cdf0e10cSrcweir // Optional standard commands 608cdf0e10cSrcweir /////////////////////////////////////////////////////////// 609cdf0e10cSrcweir ucb::CommandInfo( 610cdf0e10cSrcweir rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "delete" ) ), 611cdf0e10cSrcweir -1, 612cdf0e10cSrcweir getCppuBooleanType() 613cdf0e10cSrcweir ), 614cdf0e10cSrcweir ucb::CommandInfo( 615cdf0e10cSrcweir rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "insert" ) ), 616cdf0e10cSrcweir -1, 617cdf0e10cSrcweir getCppuVoidType() 618cdf0e10cSrcweir ), 619cdf0e10cSrcweir ucb::CommandInfo( 620cdf0e10cSrcweir rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "open" ) ), 621cdf0e10cSrcweir -1, 622cdf0e10cSrcweir getCppuType( 623cdf0e10cSrcweir static_cast< ucb::OpenCommandArgument2 * >( 0 ) ) 624cdf0e10cSrcweir ), 625cdf0e10cSrcweir ucb::CommandInfo( 626cdf0e10cSrcweir rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "transfer" ) ), 627cdf0e10cSrcweir -1, 628cdf0e10cSrcweir getCppuType( static_cast< ucb::TransferInfo * >( 0 ) ) 629cdf0e10cSrcweir ), 630cdf0e10cSrcweir ucb::CommandInfo( 631cdf0e10cSrcweir rtl::OUString( 632cdf0e10cSrcweir RTL_CONSTASCII_USTRINGPARAM( "createNewContent" ) ), 633cdf0e10cSrcweir -1, 634cdf0e10cSrcweir getCppuType( static_cast< ucb::ContentInfo * >( 0 ) ) 635cdf0e10cSrcweir ) 636cdf0e10cSrcweir /////////////////////////////////////////////////////////// 637cdf0e10cSrcweir // New commands 638cdf0e10cSrcweir /////////////////////////////////////////////////////////// 639cdf0e10cSrcweir }; 640cdf0e10cSrcweir return MAKECMDSEQUENCE( aFolderCommandInfoTable ); 641cdf0e10cSrcweir } 642cdf0e10cSrcweir } 643cdf0e10cSrcweir else 644cdf0e10cSrcweir { 645cdf0e10cSrcweir //================================================================= 646cdf0e10cSrcweir // 647cdf0e10cSrcweir // Root Folder: Supported commands 648cdf0e10cSrcweir // 649cdf0e10cSrcweir //================================================================= 650cdf0e10cSrcweir 651cdf0e10cSrcweir if ( isReadOnly() ) 652cdf0e10cSrcweir { 653cdf0e10cSrcweir static const ucb::CommandInfo aRootFolderCommandInfoTable[] = 654cdf0e10cSrcweir { 655cdf0e10cSrcweir /////////////////////////////////////////////////////////// 656cdf0e10cSrcweir // Required commands 657cdf0e10cSrcweir /////////////////////////////////////////////////////////// 658cdf0e10cSrcweir ucb::CommandInfo( 659cdf0e10cSrcweir rtl::OUString( 660cdf0e10cSrcweir RTL_CONSTASCII_USTRINGPARAM( "getCommandInfo" ) ), 661cdf0e10cSrcweir -1, 662cdf0e10cSrcweir getCppuVoidType() 663cdf0e10cSrcweir ), 664cdf0e10cSrcweir ucb::CommandInfo( 665cdf0e10cSrcweir rtl::OUString( 666cdf0e10cSrcweir RTL_CONSTASCII_USTRINGPARAM( "getPropertySetInfo" ) ), 667cdf0e10cSrcweir -1, 668cdf0e10cSrcweir getCppuVoidType() 669cdf0e10cSrcweir ), 670cdf0e10cSrcweir ucb::CommandInfo( 671cdf0e10cSrcweir rtl::OUString( 672cdf0e10cSrcweir RTL_CONSTASCII_USTRINGPARAM( "getPropertyValues" ) ), 673cdf0e10cSrcweir -1, 674cdf0e10cSrcweir getCppuType( 675cdf0e10cSrcweir static_cast< uno::Sequence< beans::Property > * >( 0 ) ) 676cdf0e10cSrcweir ), 677cdf0e10cSrcweir ucb::CommandInfo( 678cdf0e10cSrcweir rtl::OUString( 679cdf0e10cSrcweir RTL_CONSTASCII_USTRINGPARAM( "setPropertyValues" ) ), 680cdf0e10cSrcweir -1, 681cdf0e10cSrcweir getCppuType( 682cdf0e10cSrcweir static_cast< 683cdf0e10cSrcweir uno::Sequence< beans::PropertyValue > * >( 0 ) ) 684cdf0e10cSrcweir ), 685cdf0e10cSrcweir /////////////////////////////////////////////////////////// 686cdf0e10cSrcweir // Optional standard commands 687cdf0e10cSrcweir /////////////////////////////////////////////////////////// 688cdf0e10cSrcweir ucb::CommandInfo( 689cdf0e10cSrcweir rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "open" ) ), 690cdf0e10cSrcweir -1, 691cdf0e10cSrcweir getCppuType( 692cdf0e10cSrcweir static_cast< ucb::OpenCommandArgument2 * >( 0 ) ) 693cdf0e10cSrcweir ) 694cdf0e10cSrcweir /////////////////////////////////////////////////////////// 695cdf0e10cSrcweir // New commands 696cdf0e10cSrcweir /////////////////////////////////////////////////////////// 697cdf0e10cSrcweir }; 698cdf0e10cSrcweir return MAKECMDSEQUENCE( aRootFolderCommandInfoTable ); 699cdf0e10cSrcweir } 700cdf0e10cSrcweir else 701cdf0e10cSrcweir { 702cdf0e10cSrcweir static const ucb::CommandInfo aRootFolderCommandInfoTable[] = 703cdf0e10cSrcweir { 704cdf0e10cSrcweir /////////////////////////////////////////////////////////// 705cdf0e10cSrcweir // Required commands 706cdf0e10cSrcweir /////////////////////////////////////////////////////////// 707cdf0e10cSrcweir ucb::CommandInfo( 708cdf0e10cSrcweir rtl::OUString( 709cdf0e10cSrcweir RTL_CONSTASCII_USTRINGPARAM( "getCommandInfo" ) ), 710cdf0e10cSrcweir -1, 711cdf0e10cSrcweir getCppuVoidType() 712cdf0e10cSrcweir ), 713cdf0e10cSrcweir ucb::CommandInfo( 714cdf0e10cSrcweir rtl::OUString( 715cdf0e10cSrcweir RTL_CONSTASCII_USTRINGPARAM( "getPropertySetInfo" ) ), 716cdf0e10cSrcweir -1, 717cdf0e10cSrcweir getCppuVoidType() 718cdf0e10cSrcweir ), 719cdf0e10cSrcweir ucb::CommandInfo( 720cdf0e10cSrcweir rtl::OUString( 721cdf0e10cSrcweir RTL_CONSTASCII_USTRINGPARAM( "getPropertyValues" ) ), 722cdf0e10cSrcweir -1, 723cdf0e10cSrcweir getCppuType( 724cdf0e10cSrcweir static_cast< uno::Sequence< beans::Property > * >( 0 ) ) 725cdf0e10cSrcweir ), 726cdf0e10cSrcweir ucb::CommandInfo( 727cdf0e10cSrcweir rtl::OUString( 728cdf0e10cSrcweir RTL_CONSTASCII_USTRINGPARAM( "setPropertyValues" ) ), 729cdf0e10cSrcweir -1, 730cdf0e10cSrcweir getCppuType( 731cdf0e10cSrcweir static_cast< 732cdf0e10cSrcweir uno::Sequence< beans::PropertyValue > * >( 0 ) ) 733cdf0e10cSrcweir ), 734cdf0e10cSrcweir /////////////////////////////////////////////////////////// 735cdf0e10cSrcweir // Optional standard commands 736cdf0e10cSrcweir /////////////////////////////////////////////////////////// 737cdf0e10cSrcweir ucb::CommandInfo( 738cdf0e10cSrcweir rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "open" ) ), 739cdf0e10cSrcweir -1, 740cdf0e10cSrcweir getCppuType( 741cdf0e10cSrcweir static_cast< ucb::OpenCommandArgument2 * >( 0 ) ) 742cdf0e10cSrcweir ), 743cdf0e10cSrcweir ucb::CommandInfo( 744cdf0e10cSrcweir rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "transfer" ) ), 745cdf0e10cSrcweir -1, 746cdf0e10cSrcweir getCppuType( static_cast< ucb::TransferInfo * >( 0 ) ) 747cdf0e10cSrcweir ), 748cdf0e10cSrcweir ucb::CommandInfo( 749cdf0e10cSrcweir rtl::OUString( 750cdf0e10cSrcweir RTL_CONSTASCII_USTRINGPARAM( "createNewContent" ) ), 751cdf0e10cSrcweir -1, 752cdf0e10cSrcweir getCppuType( static_cast< ucb::ContentInfo * >( 0 ) ) 753cdf0e10cSrcweir ) 754cdf0e10cSrcweir /////////////////////////////////////////////////////////// 755cdf0e10cSrcweir // New commands 756cdf0e10cSrcweir /////////////////////////////////////////////////////////// 757cdf0e10cSrcweir }; 758cdf0e10cSrcweir return MAKECMDSEQUENCE( aRootFolderCommandInfoTable ); 759cdf0e10cSrcweir } 760cdf0e10cSrcweir } 761cdf0e10cSrcweir } 762