summaryrefslogtreecommitdiff
path: root/ucbhelper/workben
diff options
context:
space:
mode:
authorIvo Hinkelmann <ihi@openoffice.org>2007-06-05 13:59:46 +0000
committerIvo Hinkelmann <ihi@openoffice.org>2007-06-05 13:59:46 +0000
commitd216ddac767c091b45ad05da24b848d14938ef0a (patch)
treec6148229c9e6542a9e2ad977c4dce35bffd66429 /ucbhelper/workben
parentdf4814285a698ffac262ffe27cfb98acf8773cf2 (diff)
INTEGRATION: CWS bgdlremove (1.5.28); FILE MERGED
2007/05/30 10:50:31 kso 1.5.28.3: #i37864# - Cleanup. 2007/05/18 11:38:07 kso 1.5.28.2: #i77419# - cleanup of ucbhelper namespaces. 2007/05/11 12:52:28 kso 1.5.28.1: #i76911# - ucbhelper no longer uses VOS
Diffstat (limited to 'ucbhelper/workben')
-rw-r--r--ucbhelper/workben/myucp/myucp_contentcaps.cxx99
-rw-r--r--ucbhelper/workben/myucp/myucp_provider.cxx54
2 files changed, 73 insertions, 80 deletions
diff --git a/ucbhelper/workben/myucp/myucp_contentcaps.cxx b/ucbhelper/workben/myucp/myucp_contentcaps.cxx
index 9a911f54b05c..adb7e52c26ed 100644
--- a/ucbhelper/workben/myucp/myucp_contentcaps.cxx
+++ b/ucbhelper/workben/myucp/myucp_contentcaps.cxx
@@ -4,9 +4,9 @@
*
* $RCSfile: myucp_contentcaps.cxx,v $
*
- * $Revision: 1.5 $
+ * $Revision: 1.6 $
*
- * last change: $Author: obo $ $Date: 2006-09-16 17:25:25 $
+ * last change: $Author: ihi $ $Date: 2007-06-05 14:59:03 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
@@ -42,36 +42,22 @@
*************************************************************************/
-#ifndef _COM_SUN_STAR_BEANS_PROPERTY_HPP_
-#include <com/sun/star/beans/Property.hpp>
-#endif
-#ifndef _COM_SUN_STAR_BEANS_PROPERTYATTRIBUTE_HPP_
-#include <com/sun/star/beans/PropertyAttribute.hpp>
-#endif
-#ifndef _COM_SUN_STAR_BEANS_PROPERTYVALUE_HPP_
-#include <com/sun/star/beans/PropertyValue.hpp>
-#endif
-#ifndef _COM_SUN_STAR_UCB_COMMANDINFO_HPP_
-#include <com/sun/star/ucb/CommandInfo.hpp>
-#endif
-/*
-#ifndef _COM_SUN_STAR_UCB_INSERTCOMMANDARGUMENT_HPP_
-#include <com/sun/star/ucb/InsertCommandArgument.hpp>
-#endif
-#ifndef _COM_SUN_STAR_UCB_OPENCOMMANDARGUMENT2_HPP_
-#include <com/sun/star/ucb/OpenCommandArgument2.hpp>
-#endif
-*/
-#ifndef _COM_SUN_STAR_UNO_SEQUENCE_HXX_
-#include <com/sun/star/uno/Sequence.hxx>
-#endif
+#include "com/sun/star/beans/Property.hpp"
+#include "com/sun/star/beans/PropertyAttribute.hpp"
+#include "com/sun/star/beans/PropertyValue.hpp"
+#include "com/sun/star/ucb/CommandInfo.hpp"
+#include "com/sun/star/uno/Sequence.hxx"
-// @@@ Adjust multi-include-protection-ifdef and header file name.
-#ifndef _MYUCP_CONTENT_HXX
#include "myucp_content.hxx"
+
+#ifdef IMPLEMENT_COMMAND_INSERT
+#include "com/sun/star/ucb/InsertCommandArgument.hpp"
+#endif
+
+#ifdef IMPLEMENT_COMMAND_OPEN
+#include "com/sun/star/ucb/OpenCommandArgument2.hpp"
#endif
-using namespace com::sun;
using namespace com::sun::star;
// @@@ Adjust namespace name.
@@ -92,7 +78,7 @@ using namespace myucp;
// virtual
uno::Sequence< beans::Property > Content::getProperties(
- const uno::Reference< star::ucb::XCommandEnvironment > & xEnv )
+ const uno::Reference< ucb::XCommandEnvironment > & /*xEnv*/ )
{
// @@@ Add additional properties...
@@ -117,7 +103,7 @@ uno::Sequence< beans::Property > Content::getProperties(
static beans::Property aPropertyInfoTable[] =
{
///////////////////////////////////////////////////////////////
- // Required properties
+ // Mandatory properties
///////////////////////////////////////////////////////////////
beans::Property(
rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ContentType" ) ),
@@ -146,6 +132,7 @@ uno::Sequence< beans::Property > Content::getProperties(
///////////////////////////////////////////////////////////////
// Optional standard properties
///////////////////////////////////////////////////////////////
+
///////////////////////////////////////////////////////////////
// New properties
///////////////////////////////////////////////////////////////
@@ -156,8 +143,8 @@ uno::Sequence< beans::Property > Content::getProperties(
//=========================================================================
// virtual
-uno::Sequence< star::ucb::CommandInfo > Content::getCommands(
- const uno::Reference< star::ucb::XCommandEnvironment > & xEnv )
+uno::Sequence< ucb::CommandInfo > Content::getCommands(
+ const uno::Reference< ucb::XCommandEnvironment > & /*xEnv*/ )
{
// @@@ Add additional commands...
@@ -169,30 +156,39 @@ uno::Sequence< star::ucb::CommandInfo > Content::getCommands(
//
//=================================================================
- #define COMMAND_COUNT 4
+ sal_uInt32 nCommandCount = 4;
+#ifdef IMPLEMENT_COMMAND_DELETE
+ nCommandCount++;
+#endif
+#ifdef IMPLEMENT_COMMAND_INSERT
+ nCommandCount++;
+#endif
+#ifdef IMPLEMENT_COMMAND_OPEN
+ nCommandCount++;
+#endif
- static star::ucb::CommandInfo aCommandInfoTable[] =
+ static const ucb::CommandInfo aCommandInfoTable[] =
{
///////////////////////////////////////////////////////////////
- // Required commands
+ // Mandatory commands
///////////////////////////////////////////////////////////////
- star::ucb::CommandInfo(
+ ucb::CommandInfo(
rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "getCommandInfo" ) ),
-1,
getCppuVoidType()
),
- star::ucb::CommandInfo(
+ ucb::CommandInfo(
rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "getPropertySetInfo" ) ),
-1,
getCppuVoidType()
),
- star::ucb::CommandInfo(
+ ucb::CommandInfo(
rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "getPropertyValues" ) ),
-1,
getCppuType(
static_cast< uno::Sequence< beans::Property > * >( 0 ) )
),
- star::ucb::CommandInfo(
+ ucb::CommandInfo(
rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "setPropertyValues" ) ),
-1,
getCppuType(
@@ -201,30 +197,35 @@ uno::Sequence< star::ucb::CommandInfo > Content::getCommands(
///////////////////////////////////////////////////////////////
// Optional standard commands
///////////////////////////////////////////////////////////////
-/*
- star::ucb::CommandInfo(
+
+#ifdef IMPLEMENT_COMMAND_DELETE
+ , ucb::CommandInfo(
rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "delete" ) ),
-1,
getCppuBooleanType()
- ),
- star::ucb::CommandInfo(
+ )
+#endif
+#ifdef IMPLEMENT_COMMAND_INSERT
+ , ucb::CommandInfo(
rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "insert" ) ),
-1,
getCppuType(
- static_cast< star::ucb::InsertCommandArgument * >( 0 ) )
- ),
- star::ucb::CommandInfo(
+ static_cast< ucb::InsertCommandArgument * >( 0 ) )
+ )
+#endif
+#ifdef IMPLEMENT_COMMAND_OPEN
+ , ucb::CommandInfo(
rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "open" ) ),
-1,
- getCppuType( static_cast< star::ucb::OpenCommandArgument2 * >( 0 ) )
+ getCppuType( static_cast< ucb::OpenCommandArgument2 * >( 0 ) )
)
-*/
+#endif
///////////////////////////////////////////////////////////////
// New commands
///////////////////////////////////////////////////////////////
};
return uno::Sequence<
- star::ucb::CommandInfo >( aCommandInfoTable, COMMAND_COUNT );
+ ucb::CommandInfo >( aCommandInfoTable, nCommandCount );
}
diff --git a/ucbhelper/workben/myucp/myucp_provider.cxx b/ucbhelper/workben/myucp/myucp_provider.cxx
index 294aa955d23c..e67fb9af5057 100644
--- a/ucbhelper/workben/myucp/myucp_provider.cxx
+++ b/ucbhelper/workben/myucp/myucp_provider.cxx
@@ -4,9 +4,9 @@
*
* $RCSfile: myucp_provider.cxx,v $
*
- * $Revision: 1.5 $
+ * $Revision: 1.6 $
*
- * last change: $Author: obo $ $Date: 2006-09-16 17:25:52 $
+ * last change: $Author: ihi $ $Date: 2007-06-05 14:59:46 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
@@ -42,27 +42,18 @@
*************************************************************************/
-#ifndef _VOS_DIAGNOSE_HXX_
-#include <vos/diagnose.hxx>
-#endif
-#ifndef _UCBHELPER_CONTENTIDENTIFIER_HXX
-#include <ucbhelper/contentidentifier.hxx>
-#endif
+#include "osl/diagnose.h"
+#include "osl/mutex.hxx"
+
+#include "ucbhelper/contentidentifier.hxx"
-// @@@ Adjust multi-include-protection-ifdef and header file name.
-#ifndef _MYUCP_PROVIDER_HXX
#include "myucp_provider.hxx"
-#endif
-// @@@ Adjust multi-include-protection-ifdef and header file name.
-#ifndef _MYUCP_CONTENT_HXX
#include "myucp_content.hxx"
-#endif
-using namespace com::sun;
using namespace com::sun::star;
// @@@ Adjust namespace name.
-using namespace myucp;
+namespace myucp {
//=========================================================================
//=========================================================================
@@ -74,7 +65,7 @@ using namespace myucp;
ContentProvider::ContentProvider(
const uno::Reference< lang::XMultiServiceFactory >& rSMgr )
-: ::ucb::ContentProviderImplHelper( rSMgr )
+: ::ucbhelper::ContentProviderImplHelper( rSMgr )
{
}
@@ -94,7 +85,7 @@ ContentProvider::~ContentProvider()
XINTERFACE_IMPL_3( ContentProvider,
lang::XTypeProvider,
lang::XServiceInfo,
- star::ucb::XContentProvider );
+ ucb::XContentProvider );
//=========================================================================
//
@@ -106,7 +97,7 @@ XINTERFACE_IMPL_3( ContentProvider,
XTYPEPROVIDER_IMPL_3( ContentProvider,
lang::XTypeProvider,
lang::XServiceInfo,
- star::ucb::XContentProvider );
+ ucb::XContentProvider );
//=========================================================================
//
@@ -137,37 +128,37 @@ ONE_INSTANCE_SERVICE_FACTORY_IMPL( ContentProvider );
//=========================================================================
// virtual
-uno::Reference< star::ucb::XContent > SAL_CALL ContentProvider::queryContent(
- const uno::Reference< star::ucb::XContentIdentifier >& Identifier )
- throw( star::ucb::IllegalIdentifierException, uno::RuntimeException )
+uno::Reference< ucb::XContent > SAL_CALL ContentProvider::queryContent(
+ const uno::Reference< ucb::XContentIdentifier >& Identifier )
+ throw( ucb::IllegalIdentifierException, uno::RuntimeException )
{
// Check URL scheme...
rtl::OUString aScheme( rtl::OUString::createFromAscii( MYUCP_URL_SCHEME ) );
if ( !Identifier->getContentProviderScheme().equalsIgnoreAsciiCase( aScheme ) )
- throw star::ucb::IllegalIdentifierException();
+ throw ucb::IllegalIdentifierException();
// @@@ Further id checks may go here...
#if 0
if ( id-check-failes )
- throw star::ucb::IllegalIdentifierException();
+ throw ucb::IllegalIdentifierException();
#endif
// @@@ Id normalization may go here...
#if 0
// Normalize URL and create new Id.
rtl::OUString aCanonicURL = xxxxx( Identifier->getContentIdentifier() );
- uno::Reference< star::ucb::XContentIdentifier > xCanonicId
- = new ::ucb::ContentIdentifier( m_xSMgr, aCanonicURL );
+ uno::Reference< ucb::XContentIdentifier > xCanonicId
+ = new ::ucbhelper::ContentIdentifier( m_xSMgr, aCanonicURL );
#else
- uno::Reference< star::ucb::XContentIdentifier > xCanonicId = Identifier;
+ uno::Reference< ucb::XContentIdentifier > xCanonicId = Identifier;
#endif
- vos::OGuard aGuard( m_aMutex );
+ osl::MutexGuard aGuard( m_aMutex );
// Check, if a content with given id already exists...
- uno::Reference< star::ucb::XContent > xContent
- = queryExistingContent( xCanonicId ).getBodyPtr();
+ uno::Reference< ucb::XContent > xContent
+ = queryExistingContent( xCanonicId ).get();
if ( xContent.is() )
return xContent;
@@ -180,8 +171,9 @@ uno::Reference< star::ucb::XContent > SAL_CALL ContentProvider::queryContent(
xContent = new Content( m_xSMgr, this, xCanonicId );
if ( !xContent->getIdentifier().is() )
- throw star::ucb::IllegalIdentifierException();
+ throw ucb::IllegalIdentifierException();
return xContent;
}
+} // namespace