diff options
Diffstat (limited to 'ucb/source/ucp/hierarchy/hierarchycontentcaps.cxx')
-rw-r--r-- | ucb/source/ucp/hierarchy/hierarchycontentcaps.cxx | 107 |
1 files changed, 80 insertions, 27 deletions
diff --git a/ucb/source/ucp/hierarchy/hierarchycontentcaps.cxx b/ucb/source/ucp/hierarchy/hierarchycontentcaps.cxx index cf6e0edd3f0b..47280ec12503 100644 --- a/ucb/source/ucp/hierarchy/hierarchycontentcaps.cxx +++ b/ucb/source/ucp/hierarchy/hierarchycontentcaps.cxx @@ -47,17 +47,20 @@ IsFolder x x x x x Title x x x x x TargetURL x x + CreatableContentsInfo x x x x x getCommandInfo x x x x x getPropertySetInfo x x x x x getPropertyValues x x x x x setPropertyValues x x x x x + createNewContent x x insert x x delete x x open x x transfer x x *************************************************************************/ + #include <com/sun/star/beans/Property.hpp> #include <com/sun/star/beans/PropertyAttribute.hpp> #include <com/sun/star/beans/PropertyValue.hpp> @@ -76,6 +79,12 @@ using namespace hierarchy_ucp; // //========================================================================= +#define MAKEPROPSEQUENCE( a ) \ + uno::Sequence< beans::Property >( a, sizeof( a ) / sizeof( a[ 0 ] ) ) + +#define MAKECMDSEQUENCE( a ) \ + uno::Sequence< ucb::CommandInfo >( a, sizeof( a ) / sizeof( a[ 0 ] ) ) + //========================================================================= // // IMPORTENT: If any property data ( name / type / ... ) are changed, then @@ -143,13 +152,20 @@ uno::Sequence< beans::Property > HierarchyContent::getProperties( getCppuType( static_cast< const rtl::OUString * >( 0 ) ), beans::PropertyAttribute::BOUND | beans::PropertyAttribute::READONLY - ) + ), + beans::Property( + rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( + "CreatableContentsInfo" ) ), + -1, + getCppuType( static_cast< + const uno::Sequence< ucb::ContentInfo > * >( 0 ) ), + beans::PropertyAttribute::BOUND + | beans::PropertyAttribute::READONLY ) /////////////////////////////////////////////////////////// // New properties /////////////////////////////////////////////////////////// }; - return uno::Sequence< - beans::Property >( aLinkPropertyInfoTable, 5 ); + return MAKEPROPSEQUENCE( aLinkPropertyInfoTable ); } else { @@ -195,13 +211,20 @@ uno::Sequence< beans::Property > HierarchyContent::getProperties( -1, getCppuType( static_cast< const rtl::OUString * >( 0 ) ), beans::PropertyAttribute::BOUND - ) + ), + beans::Property( + rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( + "CreatableContentsInfo" ) ), + -1, + getCppuType( static_cast< + const uno::Sequence< ucb::ContentInfo > * >( 0 ) ), + beans::PropertyAttribute::BOUND + | beans::PropertyAttribute::READONLY ) /////////////////////////////////////////////////////////// // New properties /////////////////////////////////////////////////////////// }; - return uno::Sequence< - beans::Property >( aLinkPropertyInfoTable, 5 ); + return MAKEPROPSEQUENCE( aLinkPropertyInfoTable ); } } else if ( m_eKind == FOLDER ) @@ -248,16 +271,23 @@ uno::Sequence< beans::Property > HierarchyContent::getProperties( getCppuType( static_cast< const rtl::OUString * >( 0 ) ), beans::PropertyAttribute::BOUND | beans::PropertyAttribute::READONLY - ) + ), /////////////////////////////////////////////////////////// // Optional standard properties /////////////////////////////////////////////////////////// + beans::Property( + rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( + "CreatableContentsInfo" ) ), + -1, + getCppuType( static_cast< + const uno::Sequence< ucb::ContentInfo > * >( 0 ) ), + beans::PropertyAttribute::BOUND + | beans::PropertyAttribute::READONLY ) /////////////////////////////////////////////////////////// // New properties /////////////////////////////////////////////////////////// }; - return uno::Sequence< - beans::Property >( aFolderPropertyInfoTable, 4 ); + return MAKEPROPSEQUENCE( aFolderPropertyInfoTable ); } else { @@ -294,16 +324,23 @@ uno::Sequence< beans::Property > HierarchyContent::getProperties( -1, getCppuType( static_cast< const rtl::OUString * >( 0 ) ), beans::PropertyAttribute::BOUND - ) + ), /////////////////////////////////////////////////////////// // Optional standard properties /////////////////////////////////////////////////////////// + beans::Property( + rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( + "CreatableContentsInfo" ) ), + -1, + getCppuType( static_cast< + const uno::Sequence< ucb::ContentInfo > * >( 0 ) ), + beans::PropertyAttribute::BOUND + | beans::PropertyAttribute::READONLY ) /////////////////////////////////////////////////////////// // New properties /////////////////////////////////////////////////////////// }; - return uno::Sequence< - beans::Property >( aFolderPropertyInfoTable, 4 ); + return MAKEPROPSEQUENCE( aFolderPropertyInfoTable ); } } else @@ -314,6 +351,9 @@ uno::Sequence< beans::Property > HierarchyContent::getProperties( // //================================================================= + // Currently no difference between reonly /read-write + // -> all props ar read-only + static beans::Property aRootFolderPropertyInfoTable[] = { /////////////////////////////////////////////////////////////// @@ -346,16 +386,23 @@ uno::Sequence< beans::Property > HierarchyContent::getProperties( getCppuType( static_cast< const rtl::OUString * >( 0 ) ), beans::PropertyAttribute::BOUND | beans::PropertyAttribute::READONLY - ) + ), /////////////////////////////////////////////////////////////// // Optional standard properties /////////////////////////////////////////////////////////////// + beans::Property( + rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( + "CreatableContentsInfo" ) ), + -1, + getCppuType( static_cast< + const uno::Sequence< ucb::ContentInfo > * >( 0 ) ), + beans::PropertyAttribute::BOUND + | beans::PropertyAttribute::READONLY ) /////////////////////////////////////////////////////////////// // New properties /////////////////////////////////////////////////////////////// }; - return uno::Sequence< - beans::Property >( aRootFolderPropertyInfoTable, 4 ); + return MAKEPROPSEQUENCE( aRootFolderPropertyInfoTable ); } } @@ -416,8 +463,7 @@ uno::Sequence< ucb::CommandInfo > HierarchyContent::getCommands( // New commands /////////////////////////////////////////////////////////// }; - return uno::Sequence< - ucb::CommandInfo >( aLinkCommandInfoTable, 4 ); + return MAKECMDSEQUENCE( aLinkCommandInfoTable ); } else { @@ -470,8 +516,7 @@ uno::Sequence< ucb::CommandInfo > HierarchyContent::getCommands( // New commands /////////////////////////////////////////////////////////// }; - return uno::Sequence< - ucb::CommandInfo >( aLinkCommandInfoTable, 6 ); + return MAKECMDSEQUENCE( aLinkCommandInfoTable ); } } else if ( m_eKind == FOLDER ) @@ -529,8 +574,7 @@ uno::Sequence< ucb::CommandInfo > HierarchyContent::getCommands( // New commands /////////////////////////////////////////////////////////// }; - return uno::Sequence< - ucb::CommandInfo >( aFolderCommandInfoTable, 5 ); + return MAKECMDSEQUENCE( aFolderCommandInfoTable ); } else { @@ -589,13 +633,18 @@ uno::Sequence< ucb::CommandInfo > HierarchyContent::getCommands( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "transfer" ) ), -1, getCppuType( static_cast< ucb::TransferInfo * >( 0 ) ) + ), + ucb::CommandInfo( + rtl::OUString( + RTL_CONSTASCII_USTRINGPARAM( "createNewContent" ) ), + -1, + getCppuType( static_cast< ucb::ContentInfo * >( 0 ) ) ) /////////////////////////////////////////////////////////// // New commands /////////////////////////////////////////////////////////// }; - return uno::Sequence< - ucb::CommandInfo >( aFolderCommandInfoTable, 8 ); + return MAKECMDSEQUENCE( aFolderCommandInfoTable ); } } else @@ -653,8 +702,7 @@ uno::Sequence< ucb::CommandInfo > HierarchyContent::getCommands( // New commands /////////////////////////////////////////////////////////// }; - return uno::Sequence< - ucb::CommandInfo >( aRootFolderCommandInfoTable, 5 ); + return MAKECMDSEQUENCE( aRootFolderCommandInfoTable ); } else { @@ -703,13 +751,18 @@ uno::Sequence< ucb::CommandInfo > HierarchyContent::getCommands( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "transfer" ) ), -1, getCppuType( static_cast< ucb::TransferInfo * >( 0 ) ) + ), + ucb::CommandInfo( + rtl::OUString( + RTL_CONSTASCII_USTRINGPARAM( "createNewContent" ) ), + -1, + getCppuType( static_cast< ucb::ContentInfo * >( 0 ) ) ) /////////////////////////////////////////////////////////// // New commands /////////////////////////////////////////////////////////// }; - return uno::Sequence< - ucb::CommandInfo >( aRootFolderCommandInfoTable, 6 ); + return MAKECMDSEQUENCE( aRootFolderCommandInfoTable ); } } } |