summaryrefslogtreecommitdiff
path: root/ucbhelper/inc
diff options
context:
space:
mode:
Diffstat (limited to 'ucbhelper/inc')
-rw-r--r--ucbhelper/inc/makefile.mk48
-rw-r--r--ucbhelper/inc/pch/precompiled_ucbhelper.cxx29
-rw-r--r--ucbhelper/inc/pch/precompiled_ucbhelper.hxx32
-rw-r--r--ucbhelper/inc/ucbhelper/activedatasink.hxx75
-rw-r--r--ucbhelper/inc/ucbhelper/activedatastreamer.hxx70
-rw-r--r--ucbhelper/inc/ucbhelper/cancelcommandexecution.hxx110
-rw-r--r--ucbhelper/inc/ucbhelper/commandenvironment.hxx102
-rw-r--r--ucbhelper/inc/ucbhelper/commandenvironmentproxy.hxx99
-rw-r--r--ucbhelper/inc/ucbhelper/configurationkeys.hxx43
-rw-r--r--ucbhelper/inc/ucbhelper/content.hxx1040
-rw-r--r--ucbhelper/inc/ucbhelper/contentbroker.hxx205
-rw-r--r--ucbhelper/inc/ucbhelper/contenthelper.hxx524
-rw-r--r--ucbhelper/inc/ucbhelper/contentidentifier.hxx100
-rw-r--r--ucbhelper/inc/ucbhelper/contentinfo.hxx177
-rw-r--r--ucbhelper/inc/ucbhelper/fileidentifierconverter.hxx127
-rw-r--r--ucbhelper/inc/ucbhelper/handleinteractionrequest.hxx214
-rw-r--r--ucbhelper/inc/ucbhelper/interactionrequest.hxx727
-rw-r--r--ucbhelper/inc/ucbhelper/interceptedinteraction.hxx351
-rw-r--r--ucbhelper/inc/ucbhelper/macros.hxx747
-rw-r--r--ucbhelper/inc/ucbhelper/propertyvalueset.hxx434
-rw-r--r--ucbhelper/inc/ucbhelper/providerhelper.hxx285
-rw-r--r--ucbhelper/inc/ucbhelper/proxydecider.hxx143
-rw-r--r--ucbhelper/inc/ucbhelper/registerucb.hxx129
-rw-r--r--ucbhelper/inc/ucbhelper/resultset.hxx579
-rw-r--r--ucbhelper/inc/ucbhelper/resultsethelper.hxx220
-rw-r--r--ucbhelper/inc/ucbhelper/resultsetmetadata.hxx476
-rw-r--r--ucbhelper/inc/ucbhelper/simpleauthenticationrequest.hxx212
-rwxr-xr-xucbhelper/inc/ucbhelper/simplecertificatevalidationrequest.hxx78
-rw-r--r--ucbhelper/inc/ucbhelper/simpleinteractionrequest.hxx96
-rw-r--r--ucbhelper/inc/ucbhelper/simpleioerrorrequest.hxx75
-rw-r--r--ucbhelper/inc/ucbhelper/simplenameclashresolverequest.hxx83
-rw-r--r--ucbhelper/inc/ucbhelper/ucbhelperdllapi.h41
32 files changed, 7671 insertions, 0 deletions
diff --git a/ucbhelper/inc/makefile.mk b/ucbhelper/inc/makefile.mk
new file mode 100644
index 000000000000..c49fd40ec0e4
--- /dev/null
+++ b/ucbhelper/inc/makefile.mk
@@ -0,0 +1,48 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+PRJ=..
+
+PRJNAME=ucbhelper
+TARGET=inc
+
+# --- Settings -----------------------------------------------------
+
+.INCLUDE : settings.mk
+.INCLUDE : $(PRJ)$/util$/makefile.pmk
+
+# --- Files --------------------------------------------------------
+# --- Targets -------------------------------------------------------
+
+.INCLUDE : target.mk
+
+.IF "$(ENABLE_PCH)"!=""
+ALLTAR : \
+ $(SLO)$/precompiled.pch \
+ $(SLO)$/precompiled_ex.pch
+
+.ENDIF # "$(ENABLE_PCH)"!=""
+
diff --git a/ucbhelper/inc/pch/precompiled_ucbhelper.cxx b/ucbhelper/inc/pch/precompiled_ucbhelper.cxx
new file mode 100644
index 000000000000..2c78a928b111
--- /dev/null
+++ b/ucbhelper/inc/pch/precompiled_ucbhelper.cxx
@@ -0,0 +1,29 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#include "precompiled_ucbhelper.hxx"
+
diff --git a/ucbhelper/inc/pch/precompiled_ucbhelper.hxx b/ucbhelper/inc/pch/precompiled_ucbhelper.hxx
new file mode 100644
index 000000000000..6ce32849d6ff
--- /dev/null
+++ b/ucbhelper/inc/pch/precompiled_ucbhelper.hxx
@@ -0,0 +1,32 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+// MARKER(update_precomp.py): Generated on 2006-09-01 17:50:16.373334
+
+#ifdef PRECOMPILED_HEADERS
+#endif
+
diff --git a/ucbhelper/inc/ucbhelper/activedatasink.hxx b/ucbhelper/inc/ucbhelper/activedatasink.hxx
new file mode 100644
index 000000000000..f7cb0582fa56
--- /dev/null
+++ b/ucbhelper/inc/ucbhelper/activedatasink.hxx
@@ -0,0 +1,75 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef _UCBHELPER_ACTIVEDATASINK_HXX
+#define _UCBHELPER_ACTIVEDATASINK_HXX
+
+#include <com/sun/star/lang/XTypeProvider.hpp>
+#include <com/sun/star/io/XActiveDataSink.hpp>
+#include <cppuhelper/weak.hxx>
+#include <ucbhelper/macros.hxx>
+#include "ucbhelper/ucbhelperdllapi.h"
+
+namespace ucbhelper
+{
+
+//=========================================================================
+
+/**
+ * This class implements the interface com::sun::star::io::XActiveDataSink.
+ * Instances of this class can be passed with the parameters of an
+ * "open" command.
+ */
+
+class UCBHELPER_DLLPUBLIC ActiveDataSink : public cppu::OWeakObject,
+ public com::sun::star::lang::XTypeProvider,
+ public com::sun::star::io::XActiveDataSink
+{
+ com::sun::star::uno::Reference<
+ com::sun::star::io::XInputStream > m_xStream;
+
+public:
+ // XInterface
+ XINTERFACE_DECL()
+
+ // XTypeProvider
+ XTYPEPROVIDER_DECL()
+
+ // XActiveDataSink methods.
+ virtual void SAL_CALL
+ setInputStream( const com::sun::star::uno::Reference<
+ com::sun::star::io::XInputStream >& aStream )
+ throw( com::sun::star::uno::RuntimeException );
+ virtual com::sun::star::uno::Reference<
+ com::sun::star::io::XInputStream > SAL_CALL
+ getInputStream()
+ throw( com::sun::star::uno::RuntimeException );
+};
+
+} /* namespace ucbhelper */
+
+#endif /* !_UCBHELPER_ACTIVEDATASINK_HXX */
diff --git a/ucbhelper/inc/ucbhelper/activedatastreamer.hxx b/ucbhelper/inc/ucbhelper/activedatastreamer.hxx
new file mode 100644
index 000000000000..996f52c3884e
--- /dev/null
+++ b/ucbhelper/inc/ucbhelper/activedatastreamer.hxx
@@ -0,0 +1,70 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef _UCBHELPER_ACTIVEDATASTREAMER_HXX
+#define _UCBHELPER_ACTIVEDATASTREAMER_HXX
+
+#include <com/sun/star/lang/XTypeProvider.hpp>
+#include <com/sun/star/io/XActiveDataStreamer.hpp>
+#include <cppuhelper/weak.hxx>
+#include <ucbhelper/macros.hxx>
+
+namespace ucbhelper
+{
+
+//=========================================================================
+
+/**
+ * This class implements the interface com::sun::star::io::XActiveDataStreamer.
+ * Instances of this class can be passed with the parameters of an
+ * "open" command.
+ */
+
+class ActiveDataStreamer : public cppu::OWeakObject,
+ public com::sun::star::lang::XTypeProvider,
+ public com::sun::star::io::XActiveDataStreamer
+{
+ com::sun::star::uno::Reference<
+ com::sun::star::io::XStream > m_xStream;
+
+public:
+ // XInterface
+ XINTERFACE_DECL()
+
+ // XTypeProvider
+ XTYPEPROVIDER_DECL()
+
+ // XActiveDataStreamer methods.
+ virtual void SAL_CALL setStream( const com::sun::star::uno::Reference< com::sun::star::io::XStream >& xStream )
+ throw( com::sun::star::uno::RuntimeException );
+ virtual com::sun::star::uno::Reference< com::sun::star::io::XStream > SAL_CALL getStream()
+ throw( com::sun::star::uno::RuntimeException );
+};
+
+} /* namespace ucbhelper */
+
+#endif /* !_UCBHELPER_ACTIVEDATASTREAMER_HXX */
diff --git a/ucbhelper/inc/ucbhelper/cancelcommandexecution.hxx b/ucbhelper/inc/ucbhelper/cancelcommandexecution.hxx
new file mode 100644
index 000000000000..a23c6fc6b0fe
--- /dev/null
+++ b/ucbhelper/inc/ucbhelper/cancelcommandexecution.hxx
@@ -0,0 +1,110 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef _UCBHELPER_CANCELCOMMANDEXECUTION_HXX_
+#define _UCBHELPER_CANCELCOMMANDEXECUTION_HXX_
+
+#include <com/sun/star/uno/Reference.hxx>
+#include <com/sun/star/uno/Exception.hpp>
+#include <com/sun/star/ucb/IOErrorCode.hpp>
+#include <com/sun/star/ucb/XCommandProcessor.hpp>
+#include "ucbhelper/ucbhelperdllapi.h"
+
+namespace com { namespace sun { namespace star {
+ namespace uno { class Any; }
+ namespace ucb { class XCommandEnvironment; }
+} } }
+
+namespace ucbhelper
+{
+
+//============================================================================
+/** Cancel the execution of a command by throwing the appropriate exception.
+ If an Interaction Handler is given with the command environment and the
+ handler handles the exception by selecting the supplied continuation,
+ then this function will put the original exception supplied into a
+ com::sun::star::ucb::CommandFailedException and throw the
+ CommandFailedException. If no handler was given or the handler was not
+ able to handle the exception, then the given exception will be thrown
+ directly.
+
+ NOTE THAT THIS FUNCTION NEVER RETURNS! IT ALWAYS THROWS AN EXCEPTION!
+
+ @param rException is the exception describing the error to handle.
+
+ @param xEnv is the command environment that may contain an Interaction
+ Handler to use before throwing the appropriate exception.
+ */
+UCBHELPER_DLLPUBLIC void cancelCommandExecution( const com::sun::star::uno::Any & rException,
+ const com::sun::star::uno::Reference<
+ com::sun::star::ucb::XCommandEnvironment > &
+ xEnv )
+ throw( com::sun::star::uno::Exception );
+
+/** Cancel the execution of a command by throwing the appropriate exception.
+ If an Interaction Handler is given with the command environment and the
+ handler handles the exception by selecting the supplied continuation,
+ then this function will put the original exception supplied into a
+ com::sun::star::ucb::CommandFailedException and throw the
+ CommandFailedException. If no handler was given or the handler was not
+ able to handle the exception, then the given exception will be thrown
+ directly.
+
+ NOTE THAT THIS FUNCTION NEVER RETURNS! IT ALWAYS THROWS AN EXCEPTION!
+
+ @param eError is an IO error code.
+
+ @param rArgs is a sequeence containing the arguments to pass along with
+ the exception. Each IO error code can be combined with one or
+ more additional arguments. Refer to com/sun/star/ucb/IOErroprCode.idl
+ for details.
+
+ @param xEnv is the command environment that may contain an Interaction
+ Handler to use before throwing the appropriate exception.
+
+ @param rMessage is a text containing additional error information.
+ Used as debugging aid only. Passed to the member 'Message' of the
+ uno::Exception thrown by this function.
+
+ @param xContext is the command processor executing the command to cancel.
+ Used as debugging aid only. Passed to the member 'Context' of the
+ uno::Exception thrown by this function.
+ */
+UCBHELPER_DLLPUBLIC void cancelCommandExecution( const com::sun::star::ucb::IOErrorCode eError,
+ const com::sun::star::uno::Sequence<
+ com::sun::star::uno::Any > & rArgs,
+ const com::sun::star::uno::Reference<
+ com::sun::star::ucb::XCommandEnvironment > &
+ xEnv,
+ const rtl::OUString & rMessage = rtl::OUString(),
+ const com::sun::star::uno::Reference<
+ com::sun::star::ucb::XCommandProcessor > &
+ xContext = 0 )
+ throw( com::sun::star::uno::Exception );
+}
+
+#endif // _UCBHELPER_CANCELCOMMANDEXECUTION_HXX_
diff --git a/ucbhelper/inc/ucbhelper/commandenvironment.hxx b/ucbhelper/inc/ucbhelper/commandenvironment.hxx
new file mode 100644
index 000000000000..ddcdd5712901
--- /dev/null
+++ b/ucbhelper/inc/ucbhelper/commandenvironment.hxx
@@ -0,0 +1,102 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef _UCBHELPER_COMMANDENVIRONMENT_HXX
+#define _UCBHELPER_COMMANDENVIRONMENT_HXX
+
+#include <com/sun/star/lang/XTypeProvider.hpp>
+#ifndef _COM_SUN_STAR_UCB_XCOMMMANDENVIRONMENT_HPP_
+#include <com/sun/star/ucb/XCommandEnvironment.hpp>
+#endif
+#include <cppuhelper/weak.hxx>
+#include <ucbhelper/macros.hxx>
+#include "ucbhelper/ucbhelperdllapi.h"
+
+namespace ucbhelper
+{
+
+struct CommandEnvironment_Impl;
+
+//=========================================================================
+
+/**
+ * This class implements the interface
+ * com::sun::star::ucb::XCommandEnvironement. Instances of this class can
+ * be used to supply environments to commands executed by UCB contents.
+ */
+class UCBHELPER_DLLPUBLIC CommandEnvironment : public cppu::OWeakObject,
+ public com::sun::star::lang::XTypeProvider,
+ public com::sun::star::ucb::XCommandEnvironment
+{
+ CommandEnvironment_Impl* m_pImpl;
+
+private:
+ UCBHELPER_DLLPRIVATE CommandEnvironment( const CommandEnvironment& ); // n.i.
+ UCBHELPER_DLLPRIVATE CommandEnvironment& operator=( const CommandEnvironment& ); // n.i.
+
+public:
+ /**
+ * Constructor.
+ *
+ * @param rxInteractionHandler is the implementation of an Interaction
+ * Handler or an empty reference.
+ * @param rxProgressHandler is the implementation of a Progress
+ * Handler or an empty reference.
+ */
+ CommandEnvironment(
+ const com::sun::star::uno::Reference<
+ com::sun::star::task::XInteractionHandler >&
+ rxInteractionHandler,
+ const com::sun::star::uno::Reference<
+ com::sun::star::ucb::XProgressHandler >&
+ rxProgressHandler );
+ /**
+ * Destructor.
+ */
+ virtual ~CommandEnvironment();
+
+ // XInterface
+ XINTERFACE_DECL()
+
+ // XTypeProvider
+ XTYPEPROVIDER_DECL()
+
+ // XCommandEnvironemnt
+ virtual com::sun::star::uno::Reference<
+ com::sun::star::task::XInteractionHandler > SAL_CALL
+ getInteractionHandler()
+ throw ( com::sun::star::uno::RuntimeException );
+
+ virtual com::sun::star::uno::Reference<
+ com::sun::star::ucb::XProgressHandler > SAL_CALL
+ getProgressHandler()
+ throw ( com::sun::star::uno::RuntimeException );
+};
+
+} /* namespace ucbhelper */
+
+#endif /* !_UCBHELPER_COMMANDENVIRONMENT_HXX */
diff --git a/ucbhelper/inc/ucbhelper/commandenvironmentproxy.hxx b/ucbhelper/inc/ucbhelper/commandenvironmentproxy.hxx
new file mode 100644
index 000000000000..00724ceb4b46
--- /dev/null
+++ b/ucbhelper/inc/ucbhelper/commandenvironmentproxy.hxx
@@ -0,0 +1,99 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef _UCBHELPER_COMMANDENVIRONMENTPROXY_HXX
+#define _UCBHELPER_COMMANDENVIRONMENTPROXY_HXX
+
+#include <com/sun/star/lang/XTypeProvider.hpp>
+#ifndef _COM_SUN_STAR_UCB_XCOMMMANDENVIRONMENT_HPP_
+#include <com/sun/star/ucb/XCommandEnvironment.hpp>
+#endif
+#include <cppuhelper/weak.hxx>
+#include <ucbhelper/macros.hxx>
+
+namespace ucbhelper
+{
+
+struct CommandEnvironmentProxy_Impl;
+
+//=========================================================================
+
+/**
+ * This class implements the interface
+ * com::sun::star::ucb::XCommandEnvironement.
+ *
+ * Instances of this class can be used to create a (local) proxy for (remote)
+ * command environment implementations. This implementation caches the
+ * (remote) interfaces supplied by the given environment in order to avoid the
+ * overhead produced by multiple (remote) calls to methods of the given
+ * (remote) command environment.
+ */
+class CommandEnvironmentProxy : public cppu::OWeakObject,
+ public com::sun::star::lang::XTypeProvider,
+ public com::sun::star::ucb::XCommandEnvironment
+{
+ CommandEnvironmentProxy_Impl* m_pImpl;
+
+private:
+ CommandEnvironmentProxy( const CommandEnvironmentProxy& ); // n.i.
+ CommandEnvironmentProxy& operator=( const CommandEnvironmentProxy& ); // n.i.
+
+public:
+ /**
+ * Constructor.
+ *
+ * @param rxEnv is the implementation of a (remote) command environment.
+ */
+ CommandEnvironmentProxy(
+ const com::sun::star::uno::Reference<
+ com::sun::star::ucb::XCommandEnvironment >& rxEnv );
+ /**
+ * Destructor.
+ */
+ virtual ~CommandEnvironmentProxy();
+
+ // XInterface
+ XINTERFACE_DECL()
+
+ // XTypeProvider
+ XTYPEPROVIDER_DECL()
+
+ // XCommandEnvironemnt
+ virtual com::sun::star::uno::Reference<
+ com::sun::star::task::XInteractionHandler > SAL_CALL
+ getInteractionHandler()
+ throw ( com::sun::star::uno::RuntimeException );
+
+ virtual com::sun::star::uno::Reference<
+ com::sun::star::ucb::XProgressHandler > SAL_CALL
+ getProgressHandler()
+ throw ( com::sun::star::uno::RuntimeException );
+};
+
+} /* namespace ucbhelper */
+
+#endif /* !_UCBHELPER_COMMANDENVIRONMENTPROXY_HXX */
diff --git a/ucbhelper/inc/ucbhelper/configurationkeys.hxx b/ucbhelper/inc/ucbhelper/configurationkeys.hxx
new file mode 100644
index 000000000000..ca928b8b52bf
--- /dev/null
+++ b/ucbhelper/inc/ucbhelper/configurationkeys.hxx
@@ -0,0 +1,43 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef _UCBHELPER_CONFIGURATIONKEYS_HXX_
+#define _UCBHELPER_CONFIGURATIONKEYS_HXX_
+
+//============================================================================
+/** Various primary and secondary keys under which UCB configurations can be
+ accessed in the configuration database.
+ */
+#define UCB_CONFIGURATION_KEY1_LOCAL "Local"
+#define UCB_CONFIGURATION_KEY1_SERVER "Server"
+#define UCB_CONFIGURATION_KEY2_UNIVERSAL_CONTENT_BROKER \
+ "UniversalContentBroker"
+#define UCB_CONFIGURATION_KEY2_OFFICE "Office"
+#define UCB_CONFIGURATION_KEY2_WEB_SERVER "WebServer"
+#define UCB_CONFIGURATION_KEY2_CLIENT_ACCESS "ClientAccess"
+
+#endif // _UCBHELPER_CONFIGURATIONKEYS_HXX_
diff --git a/ucbhelper/inc/ucbhelper/content.hxx b/ucbhelper/inc/ucbhelper/content.hxx
new file mode 100644
index 000000000000..0a20592fe82a
--- /dev/null
+++ b/ucbhelper/inc/ucbhelper/content.hxx
@@ -0,0 +1,1040 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef _UCBHELPER_CONTENT_HXX
+#define _UCBHELPER_CONTENT_HXX
+
+#include "rtl/ref.hxx"
+#include <com/sun/star/ucb/ContentCreationException.hpp>
+#include <com/sun/star/ucb/CommandAbortedException.hpp>
+#include <com/sun/star/io/XStream.hpp>
+#include <com/sun/star/uno/Reference.hxx>
+#include <com/sun/star/uno/Sequence.hxx>
+#include "ucbhelper/ucbhelperdllapi.h"
+
+namespace com { namespace sun { namespace star { namespace beans {
+ class XPropertySetInfo;
+} } } }
+
+namespace com { namespace sun { namespace star { namespace io {
+ class XActiveDataSink;
+ class XOutputStream;
+ class XInputStream;
+} } } }
+
+namespace com { namespace sun { namespace star { namespace sdbc {
+ class XResultSet;
+ class XRow;
+} } } }
+
+namespace com { namespace sun { namespace star { namespace ucb {
+ class XCommandEnvironment;
+ class XCommandInfo;
+ class XContent;
+ class XContentIdentifier;
+ class XDynamicResultSet;
+ class XAnyCompareFactory;
+ struct ContentInfo;
+ struct NumberedSortingInfo;
+} } } }
+
+namespace ucbhelper
+{
+
+//=========================================================================
+
+/**
+ * These are the possible values for the parameter eMode of method
+ * ucbhelper::Content::createCursor.
+ */
+enum ResultSetInclude
+{
+ INCLUDE_FOLDERS_ONLY,
+ INCLUDE_DOCUMENTS_ONLY,
+ INCLUDE_FOLDERS_AND_DOCUMENTS
+};
+
+/**
+ * These are the possible values for the parameter eOperation of method
+ * ucbhelper::Content::insertNewContent.
+ */
+enum InsertOperation
+{
+ InsertOperation_COPY, // copy source data
+ InsertOperation_MOVE, // move source data
+ InsertOperation_LINK // create a link to source
+};
+
+//=========================================================================
+
+class Content_Impl;
+
+/**
+ * This class simplifies access to UCB contents by providing a more
+ * convenient API for frequently used functionality then the "raw"
+ * UCB-API does.
+ */
+class UCBHELPER_DLLPUBLIC Content
+{
+ rtl::Reference< Content_Impl > m_xImpl;
+
+protected:
+ ::com::sun::star::uno::Any createCursorAny( const ::com::sun::star::uno::Sequence<
+ rtl::OUString >& rPropertyNames,
+ ResultSetInclude eMode )
+ throw( ::com::sun::star::ucb::CommandAbortedException,
+ ::com::sun::star::uno::RuntimeException,
+ ::com::sun::star::uno::Exception );
+
+ ::com::sun::star::uno::Any createCursorAny( const ::com::sun::star::uno::Sequence<
+ sal_Int32 >& rPropertyHandles,
+ ResultSetInclude eMode )
+ throw( ::com::sun::star::ucb::CommandAbortedException,
+ ::com::sun::star::uno::RuntimeException,
+ ::com::sun::star::uno::Exception );
+
+public:
+ /**
+ * Constructor.
+ */
+ Content();
+
+ /**
+ * Constructor.
+ *
+ * @param rURL is the URL of the content to create.
+ * @param rEnv is the environment to use for commands executed by the
+ * content. The command environment is used by the content
+ * implementation to interact with the client and to propagate
+ * errors.
+ */
+ Content( const rtl::OUString& rURL,
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::ucb::XCommandEnvironment >& rEnv )
+ throw ( ::com::sun::star::ucb::ContentCreationException,
+ ::com::sun::star::uno::RuntimeException );
+ /**
+ * Constructor.
+ *
+ * @param rId is the content identifier of the content to create.
+ * @param rEnv is the environment to use for commands executed by the
+ * content. The command environment is used by the content
+ * implementation to interact with the client and to propagate
+ * errors.
+ */
+ Content( const ::com::sun::star::uno::Reference<
+ ::com::sun::star::ucb::XContentIdentifier >& rId,
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::ucb::XCommandEnvironment >& rEnv )
+ throw ( ::com::sun::star::ucb::ContentCreationException,
+ ::com::sun::star::uno::RuntimeException );
+ /**
+ * Constructor.
+ *
+ * @param rContent is the content object of the content to create.
+ * @param rEnv is the environment to use for commands executed by the
+ * content. The command environment is used by the content
+ * implementation to interact with the client and to propagate
+ * errors.
+ */
+ Content( const ::com::sun::star::uno::Reference<
+ ::com::sun::star::ucb::XContent >& rContent,
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::ucb::XCommandEnvironment >& rEnv )
+ throw ( ::com::sun::star::ucb::ContentCreationException,
+ ::com::sun::star::uno::RuntimeException );
+ /**
+ * Copy Constructor.
+ *
+ * @param rContent is the content this content shall be a copy of.
+ */
+ Content( const Content& rOther );
+
+ /**
+ * Destructor.
+ */
+ ~Content();
+
+ /**
+ * Assignment operator.
+ *
+ * @param rContent is the content this content shall be a copy of.
+ */
+ Content& operator=( const Content& rOther );
+
+ /**
+ * Constructor. This method should be used, if the exception thrown
+ * by the direct ctors of this class are to 'expensive' for your
+ * application
+ *
+ * @param rURL is the URL of the content to create.
+ * @param rEnv is the environment to use for commands executed by the
+ * content. The command environment is used by the content
+ * implementation to interact with the client and to propagate
+ * errors.
+ * @param rContent will be filled by this method with the content created.
+ * @return true, if the operation was successful - false, otherwise.
+ */
+ static sal_Bool
+ create( const rtl::OUString& rURL,
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::ucb::XCommandEnvironment >& rEnv,
+ Content& rContent );
+
+ /**
+ * Constructor. This method should be used, if the exception thrown
+ * by the direct ctors of this class are to 'expensive' for your
+ * application
+ *
+ * @param rId is the content identifier of the content to create.
+ * @param rEnv is the environment to use for commands executed by the
+ * content. The command environment is used by the content
+ * implementation to interact with the client and to propagate
+ * errors.
+ * @param rContent will be filled by this method with the content created.
+ * @return true, if the operation was successful - false, otherwise.
+ */
+ static sal_Bool
+ create( const ::com::sun::star::uno::Reference<
+ ::com::sun::star::ucb::XContentIdentifier >& rId,
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::ucb::XCommandEnvironment >& rEnv,
+ Content& rContent );
+
+ /**
+ * Constructor. This method should be used, if the exception thrown
+ * by the direct ctors of this class are to 'expensive' for your
+ * application
+ *
+ * @param xContent is the content object of the content to create.
+ * @param rEnv is the environment to use for commands executed by the
+ * content. The command environment is used by the content
+ * implementation to interact with the client and to propagate
+ * errors.
+ * @param rContent will be filled by this method with the content created.
+ * @return true, if the operation was successful - false, otherwise.
+ */
+ static sal_Bool
+ create( const ::com::sun::star::uno::Reference<
+ ::com::sun::star::ucb::XContent >& xContent,
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::ucb::XCommandEnvironment >& rEnv,
+ Content& rContent );
+
+ //////////////////////////////////////////////////////////////////////
+ // Direct access to UCB content.
+ //////////////////////////////////////////////////////////////////////
+
+ /**
+ * This method provides access to the "native" UCB content interface(s).
+ * This is usefull in case the convenience methods provided by this
+ * class are insufficient for your needs. You may obtain all interfaces
+ * supported by the underlying UCB content by calling this method and
+ * after that doing a queryInterface call.
+ *
+ * @return the XContent interface of the underlying UCB content.
+ */
+ ::com::sun::star::uno::Reference< ::com::sun::star::ucb::XContent >
+ get() const;
+
+ //////////////////////////////////////////////////////////////////////
+ // Object identity.
+ //////////////////////////////////////////////////////////////////////
+
+ /**
+ * This method returns the URL of the content.
+ *
+ * @return the URL of the content.
+ */
+ const ::rtl::OUString& getURL() const;
+
+ //////////////////////////////////////////////////////////////////////
+ // Command environment.
+ //////////////////////////////////////////////////////////////////////
+
+ /**
+ * This method returns the environment to use when executing commands.
+ *
+ * @return the command environment.
+ */
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::ucb::XCommandEnvironment >&
+ getCommandEnvironment() const;
+
+ /**
+ * This method sets a new command environment.
+ *
+ * @param xNewEnv is the new command environment.
+ */
+ void setCommandEnvironment(
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::ucb::XCommandEnvironment >& xNewEnv );
+
+ //////////////////////////////////////////////////////////////////////
+ // Access to supported commands/properties.
+ //////////////////////////////////////////////////////////////////////
+
+ /**
+ * This methods provides access to meta data of the commands supported
+ * by this content.
+ *
+ * @return an XCommandInfo interface implementation, which can be used
+ * to obtain meta data of the commands supported by this content.
+ */
+ ::com::sun::star::uno::Reference< ::com::sun::star::ucb::XCommandInfo >
+ getCommands()
+ throw( ::com::sun::star::ucb::CommandAbortedException,
+ ::com::sun::star::uno::RuntimeException,
+ ::com::sun::star::uno::Exception );
+ /**
+ * This methods provides access to meta data of the properties supported
+ * by this content.
+ *
+ * @return an XPropertSetInfo interface implementation, which can be used
+ * to obtain meta data of the properties supported by this content.
+ */
+ ::com::sun::star::uno::Reference<
+ ::com::sun::star::beans::XPropertySetInfo >
+ getProperties()
+ throw( ::com::sun::star::ucb::CommandAbortedException,
+ ::com::sun::star::uno::RuntimeException,
+ ::com::sun::star::uno::Exception );
+
+ //////////////////////////////////////////////////////////////////////
+ // Access to property value(s).
+ //////////////////////////////////////////////////////////////////////
+
+ /**
+ * This method can be used to read a single property value.
+ *
+ * @param rPropertyName is the name of the property for that the value
+ * shall be obtained.
+ * @return the property value.
+ */
+ ::com::sun::star::uno::Any
+ getPropertyValue( const rtl::OUString& rPropertyName )
+ throw( ::com::sun::star::ucb::CommandAbortedException,
+ ::com::sun::star::uno::RuntimeException,
+ ::com::sun::star::uno::Exception );
+ /**
+ * This method can be used to read a single property value.
+ *
+ * @param nPropertyHande is the handle of the property for that the
+ * value shall be obtained.
+ * @return the property value.
+ */
+ ::com::sun::star::uno::Any
+ getPropertyValue( sal_Int32 nPropertyHandle )
+ throw( ::com::sun::star::ucb::CommandAbortedException,
+ ::com::sun::star::uno::RuntimeException,
+ ::com::sun::star::uno::Exception );
+ /**
+ * This method can be used to set a single property value.
+ *
+ * @param rPropertyName is the name of the property for that the
+ * value shall be set.
+ * @return an any containing:
+ * - No value indicates, that the property value was set
+ * successfully.
+ * - com::sun::star::beans::UnknownPropertyException indicates,
+ * that the property is not known to the content implementation.
+ * - com::sun::star::beans::IllegalTypeException indicates, that
+ * the data type of the property value is not acceptable.
+ * - com::sun::star::lang::IllegalAccessException indicates, that
+ * the property is constant.
+ * - com::sun::star::lang::IllegalArgumentException indicates,
+ * that the property value is not acceptable. For instance,
+ * setting an empty title may be illegal.
+ * - Any other execption derived from
+ * com::sun::star::uno::Exception indicates, that the value was
+ * not set successfully. For example, this can be a
+ * com::sun:star::ucb::InteractiveAugmentedIOException
+ * transporting the error code
+ * com::sun::star::ucb::IOErrorCode::ACCESS_DENIED.
+ */
+ ::com::sun::star::uno::Any
+ setPropertyValue( const rtl::OUString& rPropertyName,
+ const ::com::sun::star::uno::Any& rValue )
+ throw( ::com::sun::star::ucb::CommandAbortedException,
+ ::com::sun::star::uno::RuntimeException,
+ ::com::sun::star::uno::Exception );
+ /**
+ * This method can be used to set a single property value.
+ *
+ * @param nPropertyHande is the handle of the property for that the
+ * value shall be set.
+ * @return an any containing:
+ * - No value indicates, that the property value was set
+ * successfully.
+ * - com::sun::star::beans::UnknownPropertyException indicates,
+ * that the property is not known to the content implementation.
+ * - com::sun::star::beans::IllegalTypeException indicates, that
+ * the data type of the property value is not acceptable.
+ * - com::sun::star::lang::IllegalAccessException indicates, that
+ * the property is constant.
+ * - com::sun::star::lang::IllegalArgumentException indicates,
+ * that the property value is not acceptable. For instance,
+ * setting an empty title may be illegal.
+ * - Any other execption derived from
+ * com::sun::star::uno::Exception indicates, that the value was
+ * not set successfully. For example, this can be a
+ * com::sun:star::ucb::InteractiveAugmentedIOException
+ * transporting the error code
+ * com::sun::star::ucb::IOErrorCode::ACCESS_DENIED.
+ */
+ ::com::sun::star::uno::Any
+ setPropertyValue( const sal_Int32 nPropertyHandle,
+ const ::com::sun::star::uno::Any& rValue )
+ throw( ::com::sun::star::ucb::CommandAbortedException,
+ ::com::sun::star::uno::RuntimeException,
+ ::com::sun::star::uno::Exception );
+ /**
+ * This method can be used to read multiple property values.
+ *
+ * @param rPropertyNames is a sequence of names of properties for
+ * that the values shall be obtained.
+ * @return the property values.
+ */
+ ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >
+ getPropertyValues( const ::com::sun::star::uno::Sequence<
+ rtl::OUString >& rPropertyNames )
+ throw( ::com::sun::star::ucb::CommandAbortedException,
+ ::com::sun::star::uno::RuntimeException,
+ ::com::sun::star::uno::Exception );
+ /**
+ * This method can be used to read multiple property values.
+ *
+ * @param nPropertyHandles is a sequence of handles of properties for
+ * that the values shall be obtained.
+ * @return an XRow interface that can be used to obtain the property
+ * values.
+ */
+ ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >
+ getPropertyValues( const ::com::sun::star::uno::Sequence<
+ sal_Int32 >& nPropertyHandles )
+ throw( ::com::sun::star::ucb::CommandAbortedException,
+ ::com::sun::star::uno::RuntimeException,
+ ::com::sun::star::uno::Exception );
+ /**
+ * This method can be used to read multiple property values.
+ *
+ * @param rPropertyNames is a sequence of names of properties for
+ * that the values shall be obtained.
+ * @return the property values.
+ */
+ ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRow >
+ getPropertyValuesInterface( const ::com::sun::star::uno::Sequence<
+ rtl::OUString >& rPropertyNames )
+ throw( ::com::sun::star::ucb::CommandAbortedException,
+ ::com::sun::star::uno::RuntimeException,
+ ::com::sun::star::uno::Exception );
+ /**
+ * This method can be used to read multiple property values.
+ *
+ * @param nPropertyHandles is a sequence of handles of properties for
+ * that the values shall be obtained.
+ * @return an XRow interface that can be used to obtain the property
+ * values.
+ */
+ ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRow >
+ getPropertyValuesInterface( const ::com::sun::star::uno::Sequence<
+ sal_Int32 >& nPropertyHandles )
+ throw( ::com::sun::star::ucb::CommandAbortedException,
+ ::com::sun::star::uno::RuntimeException,
+ ::com::sun::star::uno::Exception );
+ /**
+ * This method can be used to set multiple property values.
+ *
+ * @param rPropertyNames is a sequence of names of properties for
+ * that values shall be set.
+ * @return a sequence of any's which has exactly the same number
+ * of elements as the number of properties to set. Every
+ * sequence element contains the status for a property. The
+ * first sequence elements corresponds to the first element in
+ * the sequence of property names and so on.
+ *
+ * An any containing:
+ * - No value indicates, that the property value was set
+ * successfully.
+ * - com::sun::star::beans::UnknownPropertyException indicates,
+ * that the property is not known to the content implementation.
+ * - com::sun::star::beans::IllegalTypeException indicates, that
+ * the data type of the property value is not acceptable.
+ * - com::sun::star::lang::IllegalAccessException indicates, that
+ * the property is constant.
+ * - com::sun::star::lang::IllegalArgumentException indicates,
+ * that the property value is not acceptable. For instance,
+ * setting an empty title may be illegal.
+ * - Any other execption derived from
+ * com::sun::star::uno::Exception indicates, that the value was
+ * not set successfully. For example, this can be a
+ * com::sun:star::ucb::InteractiveAugmentedIOException
+ * transporting the error code
+ * com::sun::star::ucb::IOErrorCode::ACCESS_DENIED.
+ */
+ ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >
+ setPropertyValues( const ::com::sun::star::uno::Sequence<
+ rtl::OUString >& rPropertyNames,
+ const ::com::sun::star::uno::Sequence<
+ ::com::sun::star::uno::Any >& rValues )
+ throw( ::com::sun::star::ucb::CommandAbortedException,
+ ::com::sun::star::uno::RuntimeException,
+ ::com::sun::star::uno::Exception );
+ /**
+ * This method can be used to set multiple property values.
+ *
+ * @param nPropertyHandles is a sequence of handles of properties for
+ * that values shall be set.
+ * @return a sequence of any's which has exactly the same number
+ * of elements as the number of properties to set. Every
+ * sequence element contains the status for a property. The
+ * first sequence elements corresponds to the first element in
+ * the sequence of property names and so on.
+ *
+ * An any containing:
+ * - No value indicates, that the property value was set
+ * successfully.
+ * - com::sun::star::beans::UnknownPropertyException indicates,
+ * that the property is not known to the content implementation.
+ * - com::sun::star::beans::IllegalTypeException indicates, that
+ * the data type of the property value is not acceptable.
+ * - com::sun::star::lang::IllegalAccessException indicates, that
+ * the property is constant.
+ * - com::sun::star::lang::IllegalArgumentException indicates,
+ * that the property value is not acceptable. For instance,
+ * setting an empty title may be illegal.
+ * - Any other execption derived from
+ * com::sun::star::uno::Exception indicates, that the value was
+ * not set successfully. For example, this can be a
+ * com::sun:star::ucb::InteractiveAugmentedIOException
+ * transporting the error code
+ * com::sun::star::ucb::IOErrorCode::ACCESS_DENIED.
+ */
+ ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >
+ setPropertyValues( const ::com::sun::star::uno::Sequence<
+ sal_Int32 >& nPropertyHandles,
+ const ::com::sun::star::uno::Sequence<
+ ::com::sun::star::uno::Any >& rValues )
+ throw( ::com::sun::star::ucb::CommandAbortedException,
+ ::com::sun::star::uno::RuntimeException,
+ ::com::sun::star::uno::Exception );
+
+ //////////////////////////////////////////////////////////////////////
+ // General command execution.
+ //////////////////////////////////////////////////////////////////////
+
+ /**
+ * This method can be used to execute any command supported by the
+ * content.
+ *
+ * @param rCommandName is the name of the command to execute.
+ * @param rCommandArgument is the argument for the command. Type and
+ * values of this parameter must correspond to the command
+ * specification.
+ * @return the result of the command according to its specification.
+ */
+ ::com::sun::star::uno::Any
+ executeCommand( const rtl::OUString& rCommandName,
+ const ::com::sun::star::uno::Any& rCommandArgument )
+ throw( ::com::sun::star::ucb::CommandAbortedException,
+ ::com::sun::star::uno::RuntimeException,
+ ::com::sun::star::uno::Exception );
+ ::com::sun::star::uno::Any
+ /**
+ * This method can be used to execute any command supported by the
+ * content.
+ *
+ * @param rCommandHandle is the handle of the command to execute.
+ * @param rCommandArgument is the argument for the command. Type and
+ * values of this parameter must correspond to the command
+ * specification.
+ * @return the result of the command according to its specification.
+ */
+ executeCommand( sal_Int32 nCommandHandle,
+ const ::com::sun::star::uno::Any& rCommandArgument )
+ throw( ::com::sun::star::ucb::CommandAbortedException,
+ ::com::sun::star::uno::RuntimeException,
+ ::com::sun::star::uno::Exception );
+ /**
+ * This method can be used to abort the command currently executed by
+ * a content. Note that a content can only process one command per
+ * thread at a time. The implementation of the content is responsible
+ * for determining the command to abort when this method is called.
+ */
+ void
+ abortCommand();
+
+ //////////////////////////////////////////////////////////////////////
+ // Special commands.
+ //////////////////////////////////////////////////////////////////////
+
+ /**
+ * This methods gives access to the children of a folder content.
+ * Additionally, the result set returned provides efficient access to
+ * preselected property values of the children.
+ * Internally it executes the command "open" at the content.
+ *
+ * @param rPropertyNames is a sequence of names of properties for
+ * that the values should be accessible via the resultset
+ * returned by this method.
+ * @param eMode is a very simple filter for the children contained
+ * in the resultset.
+ * @return an implementation of the service
+ * com.cun.star.ucb.ContentResultSet, which can be used to
+ * get access to the children of a content.
+ */
+ ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet >
+ createCursor( const ::com::sun::star::uno::Sequence<
+ rtl::OUString >& rPropertyNames,
+ ResultSetInclude eMode = INCLUDE_FOLDERS_AND_DOCUMENTS )
+ throw( ::com::sun::star::ucb::CommandAbortedException,
+ ::com::sun::star::uno::RuntimeException,
+ ::com::sun::star::uno::Exception );
+ /**
+ * This methods gives access to the children of a folder content.
+ * Additionally, the result set returned provides efficient access to
+ * preselected property values of the children.
+ * Internally it executes the command "open" at the content.
+ *
+ * @param nPropertyHandles is a sequence of handles of properties for
+ * that the values should be accessible via the resultset
+ * returned by this method.
+ * @param eMode is a very simple filter for the children contained
+ * in the resultset.
+ * @return an implementation of the service
+ * com.cun.star.ucb.ContentResultSet, which can be used to
+ * get access to the children of a content.
+ */
+ ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet >
+ createCursor( const ::com::sun::star::uno::Sequence<
+ sal_Int32 >& rPropertyHandles,
+ ResultSetInclude eMode = INCLUDE_FOLDERS_AND_DOCUMENTS )
+ throw( ::com::sun::star::ucb::CommandAbortedException,
+ ::com::sun::star::uno::RuntimeException,
+ ::com::sun::star::uno::Exception );
+ /**
+ * This methods gives access to the children of a folder content.
+ * Additionally, the result set returned provides efficient access to
+ * preselected property values of the children.
+ * Internally it executes the command "open" at the content.
+ *
+ * @param rPropertyNames is a sequence of names of properties for
+ * that the values should be accessible via the resultset
+ * returned by this method.
+ * @param eMode is a very simple filter for the children contained
+ * in the resultset.
+ * @return an implementation of the service
+ * com.cun.star.ucb.DynamicResultSet, which can be used to
+ * get access to the children of a content.
+ */
+ ::com::sun::star::uno::Reference< ::com::sun::star::ucb::XDynamicResultSet >
+ createDynamicCursor( const ::com::sun::star::uno::Sequence<
+ rtl::OUString >& rPropertyNames,
+ ResultSetInclude eMode
+ = INCLUDE_FOLDERS_AND_DOCUMENTS )
+ throw( ::com::sun::star::ucb::CommandAbortedException,
+ ::com::sun::star::uno::RuntimeException,
+ ::com::sun::star::uno::Exception );
+ /**
+ * This methods gives access to the children of a folder content.
+ * Additionally, the result set returned provides efficient access to
+ * preselected property values of the children.
+ * Internally it executes the command "open" at the content.
+ *
+ * @param nPropertyHandes is a sequence of handles of properties for
+ * that the values should be accessible via the resultset
+ * returned by this method.
+ * @param eMode is a very simple filter for the children contained
+ * in the resultset.
+ * @return an implementation of the service
+ * com.cun.star.ucb.DynamicResultSet, which can be used to
+ * get access to the children of a content.
+ */
+ ::com::sun::star::uno::Reference< ::com::sun::star::ucb::XDynamicResultSet >
+ createDynamicCursor( const ::com::sun::star::uno::Sequence<
+ sal_Int32 >& rPropertyHandles,
+ ResultSetInclude eMode
+ = INCLUDE_FOLDERS_AND_DOCUMENTS )
+ throw( ::com::sun::star::ucb::CommandAbortedException,
+ ::com::sun::star::uno::RuntimeException,
+ ::com::sun::star::uno::Exception );
+
+ ::com::sun::star::uno::Reference< ::com::sun::star::ucb::XDynamicResultSet >
+ createSortedDynamicCursor( const ::com::sun::star::uno::Sequence< rtl::OUString >& rPropertyNames,
+ const ::com::sun::star::uno::Sequence< ::com::sun::star::ucb::NumberedSortingInfo >& rSortInfo,
+ ::com::sun::star::uno::Reference< ::com::sun::star::ucb::XAnyCompareFactory > rAnyCompareFactory,
+ ResultSetInclude eMode = INCLUDE_FOLDERS_AND_DOCUMENTS )
+ throw( ::com::sun::star::ucb::CommandAbortedException,
+ ::com::sun::star::uno::RuntimeException,
+ ::com::sun::star::uno::Exception );
+
+ ::com::sun::star::uno::Reference< ::com::sun::star::ucb::XDynamicResultSet >
+ createSortedDynamicCursor( const ::com::sun::star::uno::Sequence< sal_Int32 >& rPropertyHandles,
+ const ::com::sun::star::uno::Sequence< ::com::sun::star::ucb::NumberedSortingInfo >& rSortInfo,
+ ::com::sun::star::uno::Reference< ::com::sun::star::ucb::XAnyCompareFactory > rAnyCompareFactory,
+ ResultSetInclude eMode = INCLUDE_FOLDERS_AND_DOCUMENTS )
+ throw( ::com::sun::star::ucb::CommandAbortedException,
+ ::com::sun::star::uno::RuntimeException,
+ ::com::sun::star::uno::Exception );
+
+ ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet >
+ createSortedCursor( const ::com::sun::star::uno::Sequence< rtl::OUString >& rPropertyNames,
+ const ::com::sun::star::uno::Sequence< ::com::sun::star::ucb::NumberedSortingInfo >& rSortInfo,
+ ::com::sun::star::uno::Reference< ::com::sun::star::ucb::XAnyCompareFactory > rAnyCompareFactory,
+ ResultSetInclude eMode = INCLUDE_FOLDERS_AND_DOCUMENTS )
+ throw( ::com::sun::star::ucb::CommandAbortedException,
+ ::com::sun::star::uno::RuntimeException,
+ ::com::sun::star::uno::Exception );
+
+ ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet >
+ createSortedCursor( const ::com::sun::star::uno::Sequence< sal_Int32 >& rPropertyHandles,
+ const ::com::sun::star::uno::Sequence< ::com::sun::star::ucb::NumberedSortingInfo >& rSortInfo,
+ ::com::sun::star::uno::Reference< ::com::sun::star::ucb::XAnyCompareFactory > rAnyCompareFactory,
+ ResultSetInclude eMode = INCLUDE_FOLDERS_AND_DOCUMENTS )
+ throw( ::com::sun::star::ucb::CommandAbortedException,
+ ::com::sun::star::uno::RuntimeException,
+ ::com::sun::star::uno::Exception );
+
+ /**
+ * This methods gives read access to the content stream of a content (i.e
+ * the content of a file located at the local file system).
+ * Internally it executes the command "open" at the content.
+ *
+ * @return an implementation of the interface XInputStream, which can
+ * be used to read the content's data.
+ */
+ ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >
+ openStream()
+ throw( ::com::sun::star::ucb::CommandAbortedException,
+ ::com::sun::star::uno::RuntimeException,
+ ::com::sun::star::uno::Exception );
+ /**
+ * This methods gives read access to the content stream of a content (i.e
+ * the content of a file located at the local file system).
+ * Internally it executes the command "open" at the content.
+ * The method requests opening without locking.
+ *
+ * @return an implementation of the interface XInputStream, which can
+ * be used to read the content's data.
+ */
+ ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >
+ openStreamNoLock()
+ throw( ::com::sun::star::ucb::CommandAbortedException,
+ ::com::sun::star::uno::RuntimeException,
+ ::com::sun::star::uno::Exception );
+
+ /**
+ * This methods gives read/write access to the content stream of a content (i.e
+ * the content of a file located at the local file system).
+ * Internally it executes the command "open" at the content.
+ *
+ * @return an implementation of the interface XStream, which can
+ * be used to read/write the content's data.
+ */
+ ::com::sun::star::uno::Reference< ::com::sun::star::io::XStream >
+ openWriteableStream()
+ throw( ::com::sun::star::ucb::CommandAbortedException,
+ ::com::sun::star::uno::RuntimeException,
+ ::com::sun::star::uno::Exception );
+ /**
+ * This methods gives read/write access to the content stream of a content (i.e
+ * the content of a file located at the local file system).
+ * Internally it executes the command "open" at the content.
+ * The method requests opening without locking.
+ *
+ * @return an implementation of the interface XStream, which can
+ * be used to read/write the content's data.
+ */
+ ::com::sun::star::uno::Reference< ::com::sun::star::io::XStream >
+ openWriteableStreamNoLock()
+ throw( ::com::sun::star::ucb::CommandAbortedException,
+ ::com::sun::star::uno::RuntimeException,
+ ::com::sun::star::uno::Exception );
+
+ /**
+ * This methods gives read access to the content stream of a content (i.e
+ * the content of a file located at the local file system).
+ * Internally it executes the command "open" at the content.
+ *
+ * @param rSink is the implementation of an XActiveDataSink interface,
+ * which shall be used by the content to deliver the data.
+ */
+ sal_Bool
+ openStream( const ::com::sun::star::uno::Reference<
+ ::com::sun::star::io::XActiveDataSink >& rSink )
+ throw( ::com::sun::star::ucb::CommandAbortedException,
+ ::com::sun::star::uno::RuntimeException,
+ ::com::sun::star::uno::Exception );
+ /**
+ * This methods gives read access to the content stream of a content (i.e
+ * the content of a file located at the local file system).
+ * Internally it executes the command "open" at the content.
+ *
+ * @param rStream is the implementation of an XOutputStream interface,
+ * which shall be used by the content to deliver the data.
+ */
+ sal_Bool
+ openStream( const ::com::sun::star::uno::Reference<
+ ::com::sun::star::io::XOutputStream >& rStream )
+ throw( ::com::sun::star::ucb::CommandAbortedException,
+ ::com::sun::star::uno::RuntimeException,
+ ::com::sun::star::uno::Exception );
+ /**
+ * This methods gives write access to the content stream of a content (i.e
+ * the content of a file located at the local file system).
+ * Internally it executes the command "insert" at the content.
+ *
+ * @param rStream is the implementation of an XInputStream interface,
+ * which contains the content data to write.
+ * @param bReplaceExisting specifies, whether any existing content data
+ * shall be overwritten.
+ */
+ void
+ writeStream( const ::com::sun::star::uno::Reference<
+ ::com::sun::star::io::XInputStream >& rStream,
+ sal_Bool bReplaceExisting )
+ throw( ::com::sun::star::ucb::CommandAbortedException,
+ ::com::sun::star::uno::RuntimeException,
+ ::com::sun::star::uno::Exception );
+
+ /**
+ * This method returns the different types of contents this content
+ * can create.
+ *
+ * @return the content types or an empty sequence if no contents can be
+ * created by this content.
+ */
+ ::com::sun::star::uno::Sequence< ::com::sun::star::ucb::ContentInfo >
+ queryCreatableContentsInfo()
+ throw( ::com::sun::star::ucb::CommandAbortedException,
+ ::com::sun::star::uno::RuntimeException,
+ ::com::sun::star::uno::Exception );
+
+ /**
+ * This method creates, initializes and inserts ( commits ) a new content
+ * (i.e. it could be used to create a new file system folder).
+ * Internally this method does a
+ * XCommandProcessor::execute( "createNewContent", ... );
+ * XCommandProcessor::execute( "setPropertyValues", ... );
+ * XCommandProcessor::execute( "insert", ... ); calling sequence.
+ *
+ * @param rContentType is the type for the new UCB content. Each content
+ * provider implementation may introduce own types for its content
+ * objects (See queryCreatableContentsInfo()).
+ * @param rPropertyNames is a sequence of names of properties for that
+ * values are to set at the new content before it will be inserted
+ * ( commited ).
+ * The order of the names must correspond to the order of the
+ * property values.
+ * @param rPropertyValues is a sequence of property values that are to
+ * set at the new content before it will be inserted ( commited ).
+ * The order of the values must correspond to the order of the
+ * property names.
+ * @param rNewContent will be filled by the implementation of this method
+ * with the new content.
+ */
+ sal_Bool
+ insertNewContent( const ::rtl::OUString& rContentType,
+ const ::com::sun::star::uno::Sequence<
+ rtl::OUString >& rPropertyNames,
+ const ::com::sun::star::uno::Sequence<
+ ::com::sun::star::uno::Any >& rPropertyValues,
+ Content& rNewContent )
+ throw( ::com::sun::star::ucb::CommandAbortedException,
+ ::com::sun::star::uno::RuntimeException,
+ ::com::sun::star::uno::Exception );
+ /**
+ * This method creates, initializes and inserts ( commits ) a new content
+ * (i.e. it could be used to create a new file system folder).
+ * Internally this method does a
+ * XCommandProcessor::execute( "createNewContent", ... );
+ * XCommandProcessor::execute( "setPropertyValues", ... );
+ * XCommandProcessor::execute( "insert", ... ); calling sequence.
+ *
+ * @param rContentType is the type for the new UCB content. Each content
+ * provider implementation may introduce own types for its content
+ * objects (See queryCreatableContentsInfo()).
+ * @param nPropertyHandes is a sequence of handles of properties for that
+ * values are to set at the new content before it will be inserted
+ * ( commited ).
+ * The order of the handles must correspond to the order of the
+ * property values.
+ * @param rPropertyValues is a sequence of property values that are to
+ * set at the new content before it will be inserted ( commited ).
+ * The order of the values must correspond to the order of the
+ * property handles.
+ * @param rNewContent will be filled by the implementation of this method
+ * with the new content.
+ */
+ sal_Bool
+ insertNewContent( const ::rtl::OUString& rContentType,
+ const ::com::sun::star::uno::Sequence<
+ sal_Int32 >& nPropertyHandles,
+ const ::com::sun::star::uno::Sequence<
+ ::com::sun::star::uno::Any >& rPropertyValues,
+ Content& rNewContent )
+ throw( ::com::sun::star::ucb::CommandAbortedException,
+ ::com::sun::star::uno::RuntimeException,
+ ::com::sun::star::uno::Exception );
+ /**
+ * This method creates, initializes and inserts (commits) a new content
+ * inside this (the target folder) content. For example, it can be used to
+ * create a new file system file.
+ * Internally this method does a
+ * XCommandProcessor::execute( "createNewContent", ... );
+ * XCommandProcessor::execute( "setPropertyValues", ... );
+ * XCommandProcessor::execute( "insert", ... ); calling sequence.
+ *
+ * @param rContentType is the type for the new UCB content. Each content
+ * provider implementation may introduce own types for its content
+ * objects (See queryCreatableContentsInfo()).
+ * @param rPropertyNames is a sequence of names of properties for that
+ * values are to set at the new content before it will be inserted
+ * ( commited ).
+ * The order of the names must correspond to the order of the
+ * property values.
+ * @param rPropertyValues is a sequence of property values that are to
+ * set at the new content before it will be inserted ( commited ).
+ * The order of the values must correspond to the order of the
+ * property names.
+ * @param rStream is a stream containing the content data for the new
+ * content (i.e. the content of a file to create)
+ * @param rNewContent will be filled by the implementation of this method
+ * with the new content.
+ */
+ sal_Bool
+ insertNewContent( const ::rtl::OUString& rContentType,
+ const ::com::sun::star::uno::Sequence<
+ rtl::OUString >& rPropertyNames,
+ const ::com::sun::star::uno::Sequence<
+ ::com::sun::star::uno::Any >& rPropertyValues,
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::io::XInputStream >& rStream,
+ Content& rNewContent )
+ throw( ::com::sun::star::ucb::CommandAbortedException,
+ ::com::sun::star::uno::RuntimeException,
+ ::com::sun::star::uno::Exception );
+ /**
+ * This method creates, initializes and inserts (commits) a new content
+ * inside this (the target folder) content. For example, it can be used to
+ * create a new file system file.
+ * Internally this method does a
+ * XCommandProcessor::execute( "createNewContent", ... );
+ * XCommandProcessor::execute( "setPropertyValues", ... );
+ * XCommandProcessor::execute( "insert", ... ); calling sequence.
+ *
+ * @param rContentType is the type for the new UCB content. Each content
+ * provider implementation may introduce own types for its content
+ * objects (See queryCreatableContentsInfo()).
+ * @param nPropertyHandes is a sequence of handles of properties for that
+ * values are to set at the new content before it will be inserted
+ * ( commited ).
+ * The order of the handles must correspond to the order of the
+ * property values.
+ * @param rPropertyValues is a sequence of property values that are to
+ * set at the new content before it will be inserted ( commited ).
+ * The order of the values must correspond to the order of the
+ * property handles.
+ * @param rStream is a stream containing the content data for the new
+ * content (i.e. the content of a file to create)
+ * @param rNewContent will be filled by the implementation of this method
+ * with the new content.
+ */
+ sal_Bool
+ insertNewContent( const ::rtl::OUString& rContentType,
+ const ::com::sun::star::uno::Sequence<
+ sal_Int32 >& nPropertyHandles,
+ const ::com::sun::star::uno::Sequence<
+ ::com::sun::star::uno::Any >& rPropertyValues,
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::io::XInputStream >& rStream,
+ Content& rNewContent )
+ throw( ::com::sun::star::ucb::CommandAbortedException,
+ ::com::sun::star::uno::RuntimeException,
+ ::com::sun::star::uno::Exception );
+ /**
+ * This method transfers (copies/moves) a content. It creates a new
+ * resource inside this (the target folder) content.
+ * The implementation is able to do cross-provider transfers (like copying
+ * a file from the local file system to a directory located on an HTTP
+ * server).
+ * Internally this method executes the command "globalTransfer" at the UCB.
+ *
+ * @param rSourceContent is the content that contains the data for the
+ * new UCB content.
+ * @param eOperation defines what shall be done with the source data
+ * ( COPY, MOVE, LINK ).
+ * @param rTitle contains a title for the new content. If this is an empty
+ * string, the new content will have the same title as the source
+ * content.
+ * @param rNameClashAction describes how the implementation shall behave
+ * in case a content with a clashing name exists in the target
+ * folder.
+ * NameClash::ERROR will abort the operation, NameClash::OVERWRITE
+ * will overwrite the clashing content and all its data,
+ * NameClash::RENAME will generate and supply a non-clashing title.
+ * @see com/sun/star/ucb/NameClash.idl
+ */
+ sal_Bool
+ transferContent( const Content& rSourceContent,
+ InsertOperation eOperation,
+ const ::rtl::OUString & rTitle,
+ const sal_Int32 nNameClashAction )
+ throw( ::com::sun::star::ucb::CommandAbortedException,
+ ::com::sun::star::uno::RuntimeException,
+ ::com::sun::star::uno::Exception );
+
+ //////////////////////////////////////////////////////////////////////
+ // Required properties.
+ //////////////////////////////////////////////////////////////////////
+
+ /**
+ * This method returns the value of the content's property "IsFolder".
+ *
+ * @return true, if the content is a folder ( it can contain other
+ * UCB contents). false, otherwise.
+ */
+ sal_Bool
+ isFolder()
+ throw( ::com::sun::star::ucb::CommandAbortedException,
+ ::com::sun::star::uno::RuntimeException,
+ ::com::sun::star::uno::Exception );
+ /**
+ * This method returns the value of the content's property "IsDocument".
+ *
+ * @return true, if the content is a document ( it has a content stream ).
+ * false, otherwise.
+ */
+ sal_Bool
+ isDocument()
+ throw( ::com::sun::star::ucb::CommandAbortedException,
+ ::com::sun::star::uno::RuntimeException,
+ ::com::sun::star::uno::Exception );
+};
+
+} /* namespace ucbhelper */
+
+#endif /* !_UCBHELPER_CONTENT_HXX */
diff --git a/ucbhelper/inc/ucbhelper/contentbroker.hxx b/ucbhelper/inc/ucbhelper/contentbroker.hxx
new file mode 100644
index 000000000000..54139d3ffdea
--- /dev/null
+++ b/ucbhelper/inc/ucbhelper/contentbroker.hxx
@@ -0,0 +1,205 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef _UCBHELPER_CONTENTBROKER_HXX
+#define _UCBHELPER_CONTENTBROKER_HXX
+
+#include <com/sun/star/uno/Reference.hxx>
+#include <com/sun/star/uno/Sequence.h>
+
+namespace com { namespace sun { namespace star { namespace lang {
+ class XMultiServiceFactory;
+} } } }
+
+namespace com { namespace sun { namespace star { namespace ucb {
+ class XContentIdentifierFactory;
+ class XContentProvider;
+ class XContentProviderManager;
+ class XCommandProcessor;
+} } } }
+#include <ucbhelper/registerucb.hxx>
+#include "ucbhelper/ucbhelperdllapi.h"
+
+namespace ucbhelper
+{
+
+class ContentBroker_Impl;
+
+//=========================================================================
+
+/**
+ * This class simplifies access to the Universal Content Broker (UCB).
+ * Currently there can only be one UCB instance per process. This class can
+ * be used to initialize and deinitialize the Broker and to access its
+ * interfaces directly.
+ */
+class UCBHELPER_DLLPUBLIC ContentBroker
+{
+ ContentBroker_Impl* m_pImpl;
+ // The "one and only" Broker.
+ static ContentBroker* m_pTheBroker;
+
+private:
+ UCBHELPER_DLLPRIVATE ContentBroker( const ContentBroker& ); // n.i.
+ UCBHELPER_DLLPRIVATE ContentBroker& operator=( const ContentBroker& ); // n.i.
+
+ /** Constructor.
+ *
+ * @param rxSMgr is a Service Manager.
+ * @param rArguments are the arguments to pass to the
+ * com.sun.star.ucb.UniversalContentBroker service when creating it.
+ * Currently, this must be a sequence containing exactly two
+ * strings, a primary and a secondary configuration key.
+ * Refer to http://ucb.openoffice.org/docs/ucb-configuration.html
+ * for more information on UCB configuration.
+ */
+ UCBHELPER_DLLPRIVATE ContentBroker( const ::com::sun::star::uno::Reference<
+ ::com::sun::star::lang::XMultiServiceFactory >& rSMgr,
+ const ::com::sun::star::uno::Sequence<
+ ::com::sun::star::uno::Any >& rArguments );
+
+ /** Constructor.
+ *
+ * @param rxSMgr is a Service Manager.
+ * @param rData are the data for the for the content providers for
+ * the new UCB.
+ */
+ UCBHELPER_DLLPRIVATE ContentBroker( const ::com::sun::star::uno::Reference<
+ ::com::sun::star::lang::XMultiServiceFactory >& rSMgr,
+ const ContentProviderDataList & rData );
+
+protected:
+ /**
+ * Destructor.
+ */
+ ~ContentBroker();
+
+public:
+ /** Initialize "the one and only" Broker. This method must be called
+ * exactly once, before the Broker is used in any way.
+ *
+ * @param rSMgr is a factory to create services needed in the Broker's
+ * implementation.
+ *
+ * @param rArguments are the arguments to pass to the
+ * com.sun.star.ucb.UniversalContentBroker service when creating
+ * it. Currently, this must be a sequence containing exactly two
+ * strings, a primary and a secondary configuration key.
+ * Refer to http://ucb.openoffice.org/docs/ucb-configuration.html
+ * for more information on UCB configuration.
+ *
+ * @return True if creation and possible configuration of the Broker
+ * was successful.
+ */
+ static sal_Bool
+ initialize( const::com::sun::star::uno::Reference<
+ ::com::sun::star::lang::XMultiServiceFactory >& rSMgr,
+ const ::com::sun::star::uno::Sequence<
+ ::com::sun::star::uno::Any >& rArguments );
+
+ /** Initialize "the one and only" Broker. This method must be called
+ * exactly once, before the Broker is used in any way.
+ *
+ * @param rSMgr is a factory to create services needed in the Broker's
+ * implementation.
+ *
+ * @param rData are the data for the for the content providers for
+ * the UCB to initialize.
+ *
+ * @return True if creation and possible configuration of the Broker
+ * was successful.
+ */
+ static sal_Bool
+ initialize( const::com::sun::star::uno::Reference<
+ ::com::sun::star::lang::XMultiServiceFactory >& rSMgr,
+ const ContentProviderDataList & rData );
+
+ /** Deinitialize "the one and only" Broker. Once this method has been
+ * called, the Broker must not be used any longer.
+ */
+ static void
+ deinitialize();
+
+ /**
+ * This method returns the Broker, if it was already initialized.
+ *
+ * @return the Broker or 0, if ContentBroker::initialize() was not yet
+ * called or did fail.
+ */
+ static ContentBroker*
+ get();
+
+ /**
+ * This method returns the Service Manager used to instanciate the Broker.
+ *
+ * @return a Service Manager.
+ */
+ ::com::sun::star::uno::Reference<
+ ::com::sun::star::lang::XMultiServiceFactory >
+ getServiceManager() const;
+
+ /**
+ * This method returns the XContentIdentifierFactory interface of the
+ * Broker.
+ *
+ * @return a XContentIdentifierFactory interface.
+ */
+ ::com::sun::star::uno::Reference<
+ ::com::sun::star::ucb::XContentIdentifierFactory >
+ getContentIdentifierFactoryInterface() const;
+
+ /**
+ * This method returns the XContentProvider interface of the Broker.
+ *
+ * @return a XContentProvider interface.
+ */
+ ::com::sun::star::uno::Reference<
+ ::com::sun::star::ucb::XContentProvider >
+ getContentProviderInterface() const;
+
+ /**
+ * This method returns the XContentProviderManager interface of the Broker.
+ *
+ * @return a XContentProviderManager interface.
+ */
+ ::com::sun::star::uno::Reference<
+ ::com::sun::star::ucb::XContentProviderManager >
+ getContentProviderManagerInterface() const;
+
+ /**
+ * This method returns the XCommandProcessor interface of the Broker.
+ *
+ * @return a XCommandProcessor interface.
+ */
+ ::com::sun::star::uno::Reference<
+ ::com::sun::star::ucb::XCommandProcessor >
+ getCommandProcessorInterface() const;
+};
+
+} /* namespace ucbhelper */
+
+#endif /* !_UCBHELPER_CONTENTBROKER_HXX */
diff --git a/ucbhelper/inc/ucbhelper/contenthelper.hxx b/ucbhelper/inc/ucbhelper/contenthelper.hxx
new file mode 100644
index 000000000000..7950f9b84053
--- /dev/null
+++ b/ucbhelper/inc/ucbhelper/contenthelper.hxx
@@ -0,0 +1,524 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef _UCBHELPER_CONTENTHELPER_HXX
+#define _UCBHELPER_CONTENTHELPER_HXX
+
+#include <com/sun/star/beans/XPropertyContainer.hpp>
+#include <com/sun/star/beans/XPropertiesChangeNotifier.hpp>
+#include <com/sun/star/ucb/XCommandProcessor.hpp>
+#include <com/sun/star/ucb/XContent.hpp>
+#include <com/sun/star/beans/XPropertySetInfoChangeNotifier.hpp>
+#include <com/sun/star/ucb/XCommandInfoChangeNotifier.hpp>
+#include <com/sun/star/container/XChild.hpp>
+#include <com/sun/star/lang/XMultiServiceFactory.hpp>
+#include <com/sun/star/lang/XTypeProvider.hpp>
+#include <com/sun/star/lang/XServiceInfo.hpp>
+#include <com/sun/star/lang/XComponent.hpp>
+#include <com/sun/star/ucb/CommandAbortedException.hpp>
+#include <cppuhelper/weak.hxx>
+
+#include "osl/mutex.hxx"
+#include "rtl/ref.hxx"
+#include <ucbhelper/macros.hxx>
+#include "ucbhelper/ucbhelperdllapi.h"
+
+namespace com { namespace sun { namespace star { namespace ucb {
+ struct CommandInfo;
+ class XCommandEnvironment;
+ class XCommandInfo;
+ class XPersistentPropertySet;
+} } } }
+
+namespace com { namespace sun { namespace star { namespace beans {
+ struct Property;
+ class XPropertySetInfo;
+} } } }
+
+namespace ucbhelper_impl { struct ContentImplHelper_Impl; }
+
+namespace ucbhelper
+{
+
+//=========================================================================
+
+class ContentProviderImplHelper;
+
+/**
+ * This is an abstract base class for implementations of the service
+ * com.sun.star.ucb.Content. Implementations derived from this class are
+ * objects provided by implementations derived from
+ * class ucb::ContentProviderImplHelper.
+ *
+ * Features of the base class implementation:
+ * - standard interfaces ( XInterface, XTypeProvider, XServiceInfo )
+ * - all required interfaces for service com::sun::star::ucb::Content
+ * - all required listener containers
+ * ( XComponent, XPropertiesChangeNotifier, XPropertySetInfoChangeNotifier,
+ * XCommandInfoChangeNotifier )
+ * - XPropertyContainer implementation ( persistence is implemented using
+ * service com.sun.star.ucb.Store )
+ * - complete XPropertySetInfo implementation ( including Additioanl Core
+ * Properties supplied via XPropertyContainer interface )
+ * -> protected method: getPropertySetInfo
+ * - complete XCommandInfo implementation
+ * -> protected method: getCommandInfo
+ */
+class UCBHELPER_DLLPUBLIC ContentImplHelper :
+ public cppu::OWeakObject,
+ public com::sun::star::lang::XTypeProvider,
+ public com::sun::star::lang::XServiceInfo,
+ public com::sun::star::lang::XComponent,
+ public com::sun::star::ucb::XContent,
+ public com::sun::star::ucb::XCommandProcessor,
+ public com::sun::star::beans::XPropertiesChangeNotifier,
+ public com::sun::star::beans::XPropertyContainer,
+ public com::sun::star::beans::XPropertySetInfoChangeNotifier,
+ public com::sun::star::ucb::XCommandInfoChangeNotifier,
+ public com::sun::star::container::XChild
+{
+ friend class PropertySetInfo;
+ friend class CommandProcessorInfo;
+
+ ucbhelper_impl::ContentImplHelper_Impl* m_pImpl;
+
+protected:
+ osl::Mutex m_aMutex;
+ com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory >
+ m_xSMgr;
+ com::sun::star::uno::Reference< com::sun::star::ucb::XContentIdentifier >
+ m_xIdentifier;
+ rtl::Reference< ContentProviderImplHelper >
+ m_xProvider;
+ sal_uInt32 m_nCommandId;
+
+private:
+ /**
+ * Your implementation of this method must return a sequence containing
+ * the meta data of the properties supported by the content.
+ * Note: If you wish to provide your own implementation of the interface
+ * XPropertyContainer ( completely override addContent and removeContent
+ * implementation of this base class in this case ), you can supply the
+ * meta data for your Additional Core Properties here to get a fully
+ * featured getPropertySetInfo method ( see below ).
+ *
+ * @param xEnv is an environment to use for example, for interactions.
+ * @return a sequence containing the property meta data.
+ */
+ UCBHELPER_DLLPRIVATE
+ virtual com::sun::star::uno::Sequence< com::sun::star::beans::Property >
+ getProperties( const com::sun::star::uno::Reference<
+ com::sun::star::ucb::XCommandEnvironment > & xEnv ) = 0;
+
+ /**
+ * Your implementation of this method must return a sequence containing
+ * the meta data of the commands supported by the content.
+ *
+ * @param xEnv is an environment to use for example, for interactions.
+ * @return a sequence containing the command meta data.
+ */
+ UCBHELPER_DLLPRIVATE
+ virtual com::sun::star::uno::Sequence< com::sun::star::ucb::CommandInfo >
+ getCommands( const com::sun::star::uno::Reference<
+ com::sun::star::ucb::XCommandEnvironment > & xEnv ) = 0;
+
+ /**
+ * The implementation of this method shall return the URL of the parent
+ * of your content.
+ *
+ * @return the URL of the parent content or an empty string.
+ * Note that not all contents must have one parent. There may
+ * be contents with no parent. In that case an empty string must
+ * be returned. If your content has more than one parent you may
+ * return the URL of one "preferred" parent or an empty string.
+ */
+ UCBHELPER_DLLPRIVATE virtual ::rtl::OUString getParentURL() = 0;
+
+protected:
+ /**
+ * This method returns complete meta data for the properties ( including
+ * Additional Core Properties supplied via XPropertyContainer interface )
+ * supported by the content. To implement the required command
+ * "getPropertySetInfo" simply return the return value of this method.
+ *
+ * @param xEnv is an environment to use for example, for interactions.
+ * @param bCache indicates, whether the implemetation should use
+ * cached data, if exist.
+ * @return an XPropertySetInfo implementation object containing meta data
+ * for the properties supported by this content.
+ */
+ com::sun::star::uno::Reference< com::sun::star::beans::XPropertySetInfo >
+ getPropertySetInfo( const com::sun::star::uno::Reference<
+ com::sun::star::ucb::XCommandEnvironment > & xEnv,
+ sal_Bool bCache = sal_True );
+
+ /**
+ * This method returns complete meta data for the commands supported by
+ * the content. To implement the required command "getCommandInfo" simply
+ * return the return value of this method.
+ *
+ * @param xEnv is an environment to use for example, for interactions.
+ * @param bCache indicates, whether the implemetation should use
+ * cached data, if exist.
+ * @return an XCommandInfo implementation object containing meta data
+ * for the commands supported by this content.
+ */
+ com::sun::star::uno::Reference< com::sun::star::ucb::XCommandInfo >
+ getCommandInfo( const com::sun::star::uno::Reference<
+ com::sun::star::ucb::XCommandEnvironment > & xEnv,
+ sal_Bool bCache = sal_True );
+
+ /**
+ * This method can be used to propagate changes of property values.
+ *
+ * @param evt is a sequence of property change events.
+ */
+ void notifyPropertiesChange(
+ const com::sun::star::uno::Sequence<
+ com::sun::star::beans::PropertyChangeEvent >& evt ) const;
+
+ /**
+ * This method can be used to propagate changes of the propertyset
+ * info of your content (i.e. this happens if a new property is added
+ * to your content via its XPropertyContainer interface). This base class
+ * automatically generates events when the propertyset info changes. If
+ * you provide your own implementations of addproperty and removeProperty,
+ * then you must call "notifyPropertySetInfoChange" by yourself.
+ *
+ * @param evt is a sequence of property change events.
+ */
+ void notifyPropertySetInfoChange(
+ const com::sun::star::beans::PropertySetInfoChangeEvent& evt ) const;
+
+ /**
+ * This method can be used to propagate changes of the command info of
+ * your content. This can happen at any time if there shall be a new
+ * command available at a content or a currently present command shall no
+ * longer be present. (i.e. only if the content count of a trash can
+ * object is greater then zero, there will be available a command
+ * "emptyTrash". If there are no objects in the trash can, this command
+ * won't be available.
+ *
+ * @param evt is a sequence of command info change events.
+ */
+ void notifyCommandInfoChange(
+ const com::sun::star::ucb::CommandInfoChangeEvent& evt ) const;
+
+ /**
+ * This method can be used to propagate content events.
+ *
+ * @param evt is a sequence of content events.
+ */
+ void notifyContentEvent(
+ const com::sun::star::ucb::ContentEvent& evt ) const;
+
+ /**
+ * Use this method to announce the insertion of this content at
+ * the end of your implementation of the command "insert". The
+ * implementation of is method propagates a ContentEvent( INSERTED ).
+ */
+ void inserted();
+
+ /**
+ * Use this method to announce the destruction of this content at
+ * the end of your implementation of the command "delete". The
+ * implementation of is method propagates a ContentEvent( DELETED )
+ * and a ContentEvent( REMOVED ) at the parent of the deleted content,
+ * if a parent exists.
+ */
+ void deleted();
+
+ /**
+ * Use this method to change the identity of a content. The implementation
+ * of this method will replace the content identifier of the content and
+ * propagate the appropriate ContentEvent( EXCHANGED ).
+ *
+ * @param rNewId is the new content identifier for the contant.
+ * @return a success indicator.
+ */
+ sal_Bool exchange( const com::sun::star::uno::Reference<
+ com::sun::star::ucb::XContentIdentifier >& rNewId );
+
+ /**
+ * Use this method to get access to the Additional Core Properties of
+ * the content ( added using content's XPropertyContainer interface ).
+ * If you supply your own XPropertyContainer implementation, this method
+ * will always return an empty propertyset.
+ *
+ * @param bCreate indicates whether a new propertyset shall be created
+ * if it does not exist.
+ * @return the implementation of the service
+ * com.sun.star.ucb.PersistentPropertySet.
+ */
+ com::sun::star::uno::Reference<
+ com::sun::star::ucb::XPersistentPropertySet >
+ getAdditionalPropertySet( sal_Bool bCreate );
+
+ /**
+ * This method renames the propertyset containing the Additional Core
+ * Properties of the content.
+ *
+ * @param rOldKey is the old key of the propertyset.
+ * @param rNewKey is the new key for the propertyset.
+ * @param bRecursive is a flag indicating whether propertysets for
+ * children described by rOldKey shall be renamed too.
+ * @return True, if the operation succeeded - False, otherwise.
+ */
+ sal_Bool renameAdditionalPropertySet( const ::rtl::OUString& rOldKey,
+ const ::rtl::OUString& rNewKey,
+ sal_Bool bRecursive );
+
+ /**
+ * This method copies the propertyset containing the Additional Core
+ * Properties of the content.
+ *
+ * @param rSourceKey is the key of the source propertyset.
+ * @param rTargetKey is the key of the target propertyset.
+ * @param bRecursive is a flag indicating whether propertysets for
+ * children described by rSourceKey shall be copied too.
+ * @return True, if the operation succeeded - False, otherwise.
+ */
+ sal_Bool copyAdditionalPropertySet( const ::rtl::OUString& rSourceKey,
+ const ::rtl::OUString& rTargetKey,
+ sal_Bool bRecursive );
+
+ /**
+ * This method removes the propertyset containing the Additional Core
+ * Properties of the content.
+ *
+ * @param bRecursive is a flag indicating whether propertysets for
+ * children described by rOldKey shall be removed too.
+ * @return True, if the operation succeeded - False, otherwise.
+ */
+ sal_Bool removeAdditionalPropertySet( sal_Bool bRecursive );
+
+public:
+ /**
+ * Constructor.
+ *
+ * Note that the implementation of this ctor registers itself at its
+ * content provider. The provider implementation inserts the content
+ * in a hash map. So it easyly can be found and reused when the provider
+ * is asked for a content.
+ *
+ * @param rxSMgr is a Service Manager.
+ * @param rxProvider is the provider for the content.
+ * @param Identifier is the content identifier for the content.
+ */
+ ContentImplHelper(
+ const com::sun::star::uno::Reference<
+ com::sun::star::lang::XMultiServiceFactory >& rxSMgr,
+ const rtl::Reference< ContentProviderImplHelper >& rxProvider,
+ const com::sun::star::uno::Reference<
+ com::sun::star::ucb::XContentIdentifier >& Identifier );
+
+ /**
+ * Destructor.
+ *
+ * Note that the implementation of this dtor deregisters itself from its
+ * content provider. The provider implementation removes the content
+ * from a hash map.
+ */
+ virtual ~ContentImplHelper();
+
+ // XInterface
+ XINTERFACE_DECL()
+
+ // XTypeProvider
+ XTYPEPROVIDER_DECL()
+
+ // XServiceInfo
+ virtual ::rtl::OUString SAL_CALL
+ getImplementationName()
+ throw( ::com::sun::star::uno::RuntimeException ) = 0;
+ virtual sal_Bool SAL_CALL
+ supportsService( const ::rtl::OUString& ServiceName )
+ throw( ::com::sun::star::uno::RuntimeException );
+ virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL
+ getSupportedServiceNames()
+ throw( ::com::sun::star::uno::RuntimeException ) = 0;
+
+ // XComponent
+ virtual void SAL_CALL
+ dispose()
+ throw( com::sun::star::uno::RuntimeException );
+ virtual void SAL_CALL
+ addEventListener( const com::sun::star::uno::Reference<
+ com::sun::star::lang::XEventListener >& Listener )
+ throw( com::sun::star::uno::RuntimeException );
+ virtual void SAL_CALL
+ removeEventListener( const com::sun::star::uno::Reference<
+ com::sun::star::lang::XEventListener >& Listener )
+ throw( com::sun::star::uno::RuntimeException );
+
+ // XContent
+ virtual com::sun::star::uno::Reference<
+ com::sun::star::ucb::XContentIdentifier > SAL_CALL
+ getIdentifier()
+ throw( com::sun::star::uno::RuntimeException );
+ virtual rtl::OUString SAL_CALL
+ getContentType()
+ throw( com::sun::star::uno::RuntimeException ) = 0;
+ virtual void SAL_CALL
+ addContentEventListener(
+ const com::sun::star::uno::Reference<
+ com::sun::star::ucb::XContentEventListener >& Listener )
+ throw( com::sun::star::uno::RuntimeException );
+ virtual void SAL_CALL
+ removeContentEventListener(
+ const com::sun::star::uno::Reference<
+ com::sun::star::ucb::XContentEventListener >& Listener )
+ throw( com::sun::star::uno::RuntimeException );
+
+ // XCommandProcessor
+ virtual sal_Int32 SAL_CALL
+ createCommandIdentifier()
+ throw( com::sun::star::uno::RuntimeException );
+ virtual com::sun::star::uno::Any SAL_CALL
+ execute( const com::sun::star::ucb::Command& aCommand,
+ sal_Int32 CommandId,
+ const com::sun::star::uno::Reference<
+ com::sun::star::ucb::XCommandEnvironment >& Environment )
+ throw( com::sun::star::uno::Exception,
+ com::sun::star::ucb::CommandAbortedException,
+ com::sun::star::uno::RuntimeException ) = 0;
+ virtual void SAL_CALL
+ abort( sal_Int32 CommandId )
+ throw( com::sun::star::uno::RuntimeException ) = 0;
+
+ // XPropertiesChangeNotifier
+ virtual void SAL_CALL
+ addPropertiesChangeListener(
+ const com::sun::star::uno::Sequence< rtl::OUString >& PropertyNames,
+ const com::sun::star::uno::Reference<
+ com::sun::star::beans::XPropertiesChangeListener >& Listener )
+ throw( com::sun::star::uno::RuntimeException );
+ virtual void SAL_CALL
+ removePropertiesChangeListener(
+ const com::sun::star::uno::Sequence< rtl::OUString >& PropertyNames,
+ const com::sun::star::uno::Reference<
+ com::sun::star::beans::XPropertiesChangeListener >& Listener )
+ throw( com::sun::star::uno::RuntimeException );
+
+ // XCommandInfoChangeNotifier
+ virtual void SAL_CALL
+ addCommandInfoChangeListener(
+ const com::sun::star::uno::Reference<
+ com::sun::star::ucb::XCommandInfoChangeListener >& Listener )
+ throw( com::sun::star::uno::RuntimeException );
+ virtual void SAL_CALL
+ removeCommandInfoChangeListener(
+ const com::sun::star::uno::Reference<
+ ::com::sun::star::ucb::XCommandInfoChangeListener >& Listener )
+ throw( com::sun::star::uno::RuntimeException );
+
+ // XPropertyContainer
+
+ /**
+ * This method adds a property to the content according to the interface
+ * specification. The properties will be stored using the service
+ * com.sun.star.ucb.Store.
+ *
+ * Note: You may provide your own implementation of this method, for
+ * instance, if your data source supports adding/removing of properties.
+ * Don't forget to return the meta data for these properties in your
+ * implementation of getPropertyInfoTable.
+ */
+ virtual void SAL_CALL
+ addProperty( const rtl::OUString& Name,
+ sal_Int16 Attributes,
+ const com::sun::star::uno::Any& DefaultValue )
+ throw( com::sun::star::beans::PropertyExistException,
+ com::sun::star::beans::IllegalTypeException,
+ com::sun::star::lang::IllegalArgumentException,
+ com::sun::star::uno::RuntimeException );
+
+ /**
+ * This method removes a property from the content according to the
+ * interface specification. The properties will be stored using the
+ * service com.sun.star.ucb.Store.
+ *
+ * Note: You may provide your own implementation of this method, for
+ * instance, if your data source supports adding/removing of properties.
+ * Don't forget to return the meta data for these properties in your
+ * implementation of getPropertyInfoTable.
+ */
+ virtual void SAL_CALL
+ removeProperty( const rtl::OUString& Name )
+ throw( com::sun::star::beans::UnknownPropertyException,
+ com::sun::star::beans::NotRemoveableException,
+ com::sun::star::uno::RuntimeException );
+
+ // XPropertySetInfoChangeNotifier
+ virtual void SAL_CALL
+ addPropertySetInfoChangeListener(
+ const com::sun::star::uno::Reference<
+ com::sun::star::beans::XPropertySetInfoChangeListener >& Listener )
+ throw( com::sun::star::uno::RuntimeException );
+ virtual void SAL_CALL
+ removePropertySetInfoChangeListener(
+ const com::sun::star::uno::Reference<
+ com::sun::star::beans::XPropertySetInfoChangeListener >& Listener )
+ throw( com::sun::star::uno::RuntimeException );
+
+ // XChild
+
+ /**
+ * This method returns the content representing the parent of a content,
+ * if such a parent exists. The implementation of this method uses your
+ * implementation of getParentURL.
+ */
+ virtual com::sun::star::uno::Reference<
+ com::sun::star::uno::XInterface > SAL_CALL
+ getParent()
+ throw( com::sun::star::uno::RuntimeException );
+
+ /**
+ * The implementation of this method always throws a NoSupportException.
+ */
+ virtual void SAL_CALL
+ setParent( const com::sun::star::uno::Reference<
+ com::sun::star::uno::XInterface >& Parent )
+ throw( com::sun::star::lang::NoSupportException,
+ com::sun::star::uno::RuntimeException );
+
+ //////////////////////////////////////////////////////////////////////
+ // Non-interface methods.
+ //////////////////////////////////////////////////////////////////////
+
+ /**
+ * This method returns the provider of the content.
+ *
+ * @return the provider of the content.
+ */
+ const rtl::Reference< ContentProviderImplHelper >& getProvider() const
+ { return m_xProvider; }
+};
+
+} // namespace ucbhelper
+
+#endif /* !_UCBHELPER_CONTENTHELPER_HXX */
diff --git a/ucbhelper/inc/ucbhelper/contentidentifier.hxx b/ucbhelper/inc/ucbhelper/contentidentifier.hxx
new file mode 100644
index 000000000000..2bd1cca50e36
--- /dev/null
+++ b/ucbhelper/inc/ucbhelper/contentidentifier.hxx
@@ -0,0 +1,100 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef _UCBHELPER_CONTENTIDENTIFIER_HXX
+#define _UCBHELPER_CONTENTIDENTIFIER_HXX
+
+#include <cppuhelper/weak.hxx>
+#include <com/sun/star/lang/XTypeProvider.hpp>
+#include <com/sun/star/ucb/XContentIdentifier.hpp>
+#include "ucbhelper/ucbhelperdllapi.h"
+
+namespace com { namespace sun { namespace star { namespace lang {
+ class XMultiServiceFactory;
+} } } }
+
+namespace rtl {
+ class OUString;
+}
+
+namespace ucbhelper
+{
+
+struct ContentIdentifier_Impl;
+
+//=========================================================================
+
+/**
+ * This class implements a simple identifier object for UCB contents.
+ * It mainly stores and returns the URL as it was passed to the constructor -
+ * The only difference is that the URL scheme will be lower cased. This can
+ * be done, because URL schemes are never case sensitive.
+ */
+class UCBHELPER_DLLPUBLIC ContentIdentifier :
+ public cppu::OWeakObject,
+ public com::sun::star::lang::XTypeProvider,
+ public com::sun::star::ucb::XContentIdentifier
+{
+public:
+ ContentIdentifier( const com::sun::star::uno::Reference<
+ com::sun::star::lang::XMultiServiceFactory >& rxSMgr,
+ const rtl::OUString& rURL );
+ ContentIdentifier( const rtl::OUString& rURL );
+ virtual ~ContentIdentifier();
+
+ // XInterface
+ virtual com::sun::star::uno::Any SAL_CALL
+ queryInterface( const com::sun::star::uno::Type & rType )
+ throw( com::sun::star::uno::RuntimeException );
+ virtual void SAL_CALL
+ acquire() throw();
+ virtual void SAL_CALL
+ release() throw();
+
+ // XTypeProvider
+ virtual com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL
+ getImplementationId()
+ throw( com::sun::star::uno::RuntimeException );
+ virtual com::sun::star::uno::Sequence< com::sun::star::uno::Type > SAL_CALL
+ getTypes()
+ throw( com::sun::star::uno::RuntimeException );
+
+ // XContentIdentifier
+ virtual rtl::OUString SAL_CALL
+ getContentIdentifier()
+ throw( com::sun::star::uno::RuntimeException );
+ virtual rtl::OUString SAL_CALL
+ getContentProviderScheme()
+ throw( com::sun::star::uno::RuntimeException );
+
+private:
+ ContentIdentifier_Impl* m_pImpl;
+};
+
+} /* namespace ucbhelper */
+
+#endif /* !_UCBHELPER_CONTENTIDENTIFIER_HXX */
diff --git a/ucbhelper/inc/ucbhelper/contentinfo.hxx b/ucbhelper/inc/ucbhelper/contentinfo.hxx
new file mode 100644
index 000000000000..1584645771c7
--- /dev/null
+++ b/ucbhelper/inc/ucbhelper/contentinfo.hxx
@@ -0,0 +1,177 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef _UCBHELPER_CONTENTINFO_HXX
+#define _UCBHELPER_CONTENTINFO_HXX
+
+#include <com/sun/star/ucb/XCommandInfo.hpp>
+#include <com/sun/star/ucb/XCommandEnvironment.hpp>
+#include <com/sun/star/lang/XMultiServiceFactory.hpp>
+#include <com/sun/star/lang/XTypeProvider.hpp>
+#include <com/sun/star/beans/XPropertySetInfo.hpp>
+#include <cppuhelper/weak.hxx>
+
+#include "osl/mutex.hxx"
+#include <ucbhelper/macros.hxx>
+
+namespace ucbhelper {
+
+//============================================================================
+//
+// class PropertySetInfo.
+//
+//============================================================================
+
+class ContentImplHelper;
+
+/**
+ * This class provides a propertyset info ( the complete implementation of
+ * the interface XPropertySetInfo ) for an object derived from class
+ * ucb::ContentImplHelper. The implementation takes care about Additional
+ * Core Properties that may have been added to the content.
+ */
+class PropertySetInfo :
+ public cppu::OWeakObject,
+ public com::sun::star::lang::XTypeProvider,
+ public com::sun::star::beans::XPropertySetInfo
+{
+ com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory >
+ m_xSMgr;
+ com::sun::star::uno::Reference< com::sun::star::ucb::XCommandEnvironment >
+ m_xEnv;
+ com::sun::star::uno::Sequence< com::sun::star::beans::Property >*
+ m_pProps;
+ osl::Mutex m_aMutex;
+ ContentImplHelper* m_pContent;
+
+private:
+ sal_Bool queryProperty( const rtl::OUString& rName,
+ com::sun::star::beans::Property& rProp );
+
+public:
+ PropertySetInfo( const com::sun::star::uno::Reference<
+ com::sun::star::lang::XMultiServiceFactory >& rxSMgr,
+ const com::sun::star::uno::Reference<
+ com::sun::star::ucb::XCommandEnvironment >& rxEnv,
+ ContentImplHelper* pContent );
+ virtual ~PropertySetInfo();
+
+ // XInterface
+ XINTERFACE_DECL()
+
+ // XTypeProvider
+ XTYPEPROVIDER_DECL()
+
+ // XPropertySetInfo
+ virtual com::sun::star::uno::Sequence<
+ com::sun::star::beans::Property > SAL_CALL
+ getProperties()
+ throw( com::sun::star::uno::RuntimeException );
+ virtual com::sun::star::beans::Property SAL_CALL
+ getPropertyByName( const rtl::OUString& aName )
+ throw( com::sun::star::beans::UnknownPropertyException,
+ com::sun::star::uno::RuntimeException );
+ virtual sal_Bool SAL_CALL
+ hasPropertyByName( const rtl::OUString& Name )
+ throw( com::sun::star::uno::RuntimeException );
+
+ // Non-Interface methods.
+ void reset();
+};
+
+//============================================================================
+//
+// class CommandProcessorInfo.
+//
+//============================================================================
+
+/**
+ * This class provides a command info ( the complete implementation of
+ * the interface XCommandInfo ) for an object derived from class
+ * ucb::ContentImplHelper.
+ */
+class CommandProcessorInfo :
+ public cppu::OWeakObject,
+ public com::sun::star::lang::XTypeProvider,
+ public com::sun::star::ucb::XCommandInfo
+{
+ com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory >
+ m_xSMgr;
+ com::sun::star::uno::Reference< com::sun::star::ucb::XCommandEnvironment >
+ m_xEnv;
+ com::sun::star::uno::Sequence< com::sun::star::ucb::CommandInfo >*
+ m_pCommands;
+ osl::Mutex m_aMutex;
+ ContentImplHelper* m_pContent;
+
+private:
+ sal_Bool queryCommand( const rtl::OUString& rName,
+ com::sun::star::ucb::CommandInfo& rCommand );
+ sal_Bool queryCommand( sal_Int32 nHandle,
+ com::sun::star::ucb::CommandInfo& rCommand );
+
+public:
+ CommandProcessorInfo( const com::sun::star::uno::Reference<
+ com::sun::star::lang::XMultiServiceFactory >& rxSMgr,
+ const com::sun::star::uno::Reference<
+ com::sun::star::ucb::XCommandEnvironment >& rxEnv,
+ ContentImplHelper* pContent );
+ virtual ~CommandProcessorInfo();
+
+ // XInterface
+ XINTERFACE_DECL()
+
+ // XTypeProvider
+ XTYPEPROVIDER_DECL()
+
+ // XCommandInfo
+ virtual com::sun::star::uno::Sequence<
+ com::sun::star::ucb::CommandInfo > SAL_CALL
+ getCommands()
+ throw( com::sun::star::uno::RuntimeException );
+ virtual com::sun::star::ucb::CommandInfo SAL_CALL
+ getCommandInfoByName( const rtl::OUString& Name )
+ throw( com::sun::star::ucb::UnsupportedCommandException,
+ com::sun::star::uno::RuntimeException );
+ virtual com::sun::star::ucb::CommandInfo SAL_CALL
+ getCommandInfoByHandle( sal_Int32 Handle )
+ throw( com::sun::star::ucb::UnsupportedCommandException,
+ com::sun::star::uno::RuntimeException );
+ virtual sal_Bool SAL_CALL
+ hasCommandByName( const rtl::OUString& Name )
+ throw( com::sun::star::uno::RuntimeException );
+ virtual sal_Bool SAL_CALL
+ hasCommandByHandle( sal_Int32 Handle )
+ throw( com::sun::star::uno::RuntimeException );
+
+ // Non-Interface methods.
+ void reset();
+};
+
+} // namespace ucbhelper
+
+#endif /* !_UCBHELPER_CONTENTINFO_HXX */
diff --git a/ucbhelper/inc/ucbhelper/fileidentifierconverter.hxx b/ucbhelper/inc/ucbhelper/fileidentifierconverter.hxx
new file mode 100644
index 000000000000..15db85760619
--- /dev/null
+++ b/ucbhelper/inc/ucbhelper/fileidentifierconverter.hxx
@@ -0,0 +1,127 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef _UCBHELPER_FILEIDENTIFIERCONVERTER_HXX_
+#define _UCBHELPER_FILEIDENTIFIERCONVERTER_HXX_
+
+#include <com/sun/star/uno/Reference.hxx>
+#include <com/sun/star/uno/RuntimeException.hpp>
+#include <sal/types.h>
+#include "ucbhelper/ucbhelperdllapi.h"
+
+namespace com { namespace sun { namespace star { namespace ucb {
+ class XContentProviderManager;
+} } } }
+namespace rtl { class OUString; }
+
+namespace ucbhelper {
+
+//============================================================================
+/** Get a 'root' URL for the most 'local' file content provider.
+
+ @descr
+ The result can be used as the rBaseURL parameter of
+ ucb::getFileURLFromSystemPath().
+
+ @param rManager
+ A content provider manager. Must not be null.
+
+ @returns
+ either a 'root' URL for the most 'local' file content provider, or an
+ empty string, if no such URL can meaningfully be constructed.
+ */
+UCBHELPER_DLLPUBLIC rtl::OUString getLocalFileURL(
+ com::sun::star::uno::Reference<
+ com::sun::star::ucb::XContentProviderManager > const &
+ rManager)
+ SAL_THROW((com::sun::star::uno::RuntimeException));
+
+//============================================================================
+/** Using a specific content provider manager, convert a file path in system
+ dependent notation to a (file) URL.
+
+ @param rManager
+ A content provider manager. Must not be null.
+
+ @param rBaseURL
+ See the corresponding parameter of
+ com::sun::star::ucb::XFileIdentifierConverter::getFileURLFromSystemPath().
+
+ @param rURL
+ See the corresponding parameter of
+ com::sun::star::ucb::XFileIdentifierConverter::getFileURLFromSystemPath().
+
+ @returns
+ a URL, if the content provider registered at the content provider manager
+ that is responsible for the base URL returns a URL when calling
+ com::sun::star::ucb::XFileIdentiferConverter::getFileURLFromSystemPath()
+ on it. Otherwise, an empty string is returned.
+
+ @see
+ com::sun::star::ucb::XFileIdentiferConverter::getFileURLFromSystemPath().
+ */
+UCBHELPER_DLLPUBLIC rtl::OUString
+getFileURLFromSystemPath(
+ com::sun::star::uno::Reference<
+ com::sun::star::ucb::XContentProviderManager > const &
+ rManager,
+ rtl::OUString const & rBaseURL,
+ rtl::OUString const & rSystemPath)
+ SAL_THROW((com::sun::star::uno::RuntimeException));
+
+//============================================================================
+/** Using a specific content provider manager, convert a (file) URL to a
+ file path in system dependent notation.
+
+ @param rManager
+ A content provider manager. Must not be null.
+
+ @param rURL
+ See the corresponding parameter of
+ com::sun::star::ucb::XFileIdentiferConverter::getSystemPathFromFileURL().
+
+ @returns
+ a system path, if the content provider registered at the content provider
+ manager that is responsible for the base URL returns a system path when
+ calling
+ com::sun::star::ucb::XFileIdentiferConverter::getSystemPathFromFileURL()
+ on it. Otherwise, an empty string is returned.
+
+ @see
+ com::sun::star::ucb::XFileIdentiferConverter::getSystemPathFromFileURL().
+ */
+UCBHELPER_DLLPUBLIC rtl::OUString
+getSystemPathFromFileURL(
+ com::sun::star::uno::Reference<
+ com::sun::star::ucb::XContentProviderManager > const &
+ rManager,
+ rtl::OUString const & rURL)
+ SAL_THROW((com::sun::star::uno::RuntimeException));
+
+}
+
+#endif // _UCBHELPER_FILEIDENTIFIERCONVERTER_HXX_
diff --git a/ucbhelper/inc/ucbhelper/handleinteractionrequest.hxx b/ucbhelper/inc/ucbhelper/handleinteractionrequest.hxx
new file mode 100644
index 000000000000..9ce8122efc3f
--- /dev/null
+++ b/ucbhelper/inc/ucbhelper/handleinteractionrequest.hxx
@@ -0,0 +1,214 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef INCLUDED_UCBHELPER_HANDLEINTERACTIONREQUEST_HXX
+#define INCLUDED_UCBHELPER_HANDLEINTERACTIONREQUEST_HXX
+
+#include "com/sun/star/uno/Exception.hpp"
+#include "com/sun/star/uno/Reference.hxx"
+#include "rtl/ref.hxx"
+#include "sal/types.h"
+
+#ifndef INCLUDED_UTILITY
+#include <utility>
+#define INCLUDED_UTILITY
+#endif
+
+namespace com { namespace sun { namespace star { namespace ucb {
+ class XCommandEnvironment;
+} } } }
+namespace ucbhelper {
+ class InteractionSupplyAuthentication;
+ class SimpleAuthenticationRequest;
+ class SimpleInteractionRequest;
+ class SimpleCertificateValidationRequest;
+}
+
+/** Pass a <type scope="ucbhelper">SimpleInteractionRequest</type> to an
+ <type scope="com::sun::star::task">XInteractionHandler</type>, and handle
+ (by throwing the request as an exception) those cases where an interaction
+ handler is either not available or does not handle the request.
+
+ @param rRequest
+ a <type scope="ucbhelper">SimpleInteractionRequest</type>. Must not be
+ <NULL/>.
+
+ @param rEnvironment
+ At the moment, only the
+ <type scope="com::sun::star::task">XInteractionHandler</type> part is
+ used. May be <NULL/>.
+
+ @param bThrowOnAbort
+ determines what is done if the interaction handler selects a
+ <const scope="ucbhelper">CONTINUATION_ABORT</const> continuation: If
+ <TRUE/>, an appropriate
+ <type scope="com::sun::star::ucb">CommandFailedException</type> is thrown.
+ If <FALSE/>, <const scope="ucbhelper">CONTINUATION_ABORT</const> is passed
+ to the caller of this function.
+
+ @returns
+ the constant (defined in ucbhelper/simpelinteractionrequest.hxx) that
+ corresponds to the continuation selected by the interaction handler.
+ The constant <const scope="ucbhelper">CONTINUATION_UNKNOWN</const> will
+ never be returned.
+
+ @throws
+ <ul>
+ <li>the exception specified by the request, if an interaction handler is
+ either not available or does not handle the request;</li>
+ <li>a <type scope="com::sun::star::ucb">CommandFailedException</type> if
+ the interaction handler selects a
+ <const scope="ucbhelper">CONTINUATION_ABORT</const> continuation and
+ <code>bThrowOnAbort</code> is <TRUE/>;</li>
+ <li>a <type scope="com::sun::star::uno">RuntimeException</type> if such an
+ exception is thrown by code called from within this function.</li>
+ </ul>
+ */
+namespace ucbhelper {
+
+sal_Int32
+handleInteractionRequest(
+ rtl::Reference< ucbhelper::SimpleInteractionRequest > const & rRequest,
+ com::sun::star::uno::Reference<
+ com::sun::star::ucb::XCommandEnvironment > const &
+ rEnvironment,
+ bool bThrowOnAbort = true)
+ SAL_THROW((com::sun::star::uno::Exception));
+
+}
+
+/** Pass a <type scope="ucbhelper">SimpleAuthenticationRequest</type> to an
+ <type scope="com::sun::star::task">XInteractionHandler</type>, and handle
+ (by throwing the request as an exception) those cases where an interaction
+ handler is either not available or does not handle the request.
+
+ @param rRequest
+ a <type scope="ucbhelper">SimpleAuthenticationRequest</type>. Must not be
+ <NULL/>.
+
+ @param rEnvironment
+ At the moment, only the
+ <type scope="com::sun::star::task">XInteractionHandler</type> part is
+ used. May be <NULL/>.
+
+ @param bThrowOnAbort
+ determines what is done if the interaction handler selects a
+ <const scope="ucbhelper">CONTINUATION_ABORT</const> continuation: If
+ <TRUE/>, an appropriate
+ <type scope="com::sun::star::ucb">CommandFailedException</type> is thrown.
+ If <FALSE/>, <const scope="ucbhelper">CONTINUATION_ABORT</const> is passed
+ to the caller of this function.
+
+ @returns
+ either a pair consisting of one of the constants
+ <const scope="ucbhelper">CONTINUATION_ABORT</const> or
+ <const scope="ucbhelper">CONTINUATION_RETRY</const> (defined in
+ ucbhelper/simpelinteractionrequest.hxx) and an empty reference, or a pair
+ consisting of the constant
+ <const scope="ucbhelper">CONTINUATION_UNKNOWN</const> and a reference to
+ an <type scope="ucbhelper">InteractionSupplyAuthentication</type> that
+ contains the supplied data.
+
+ @throws
+ <ul>
+ <li>the exception specified by the request, if an interaction handler is
+ either not available or does not handle the request;</li>
+ <li>a <type scope="com::sun::star::ucb">CommandFailedException</type> if
+ the interaction handler selects a
+ <const scope="ucbhelper">CONTINUATION_ABORT</const> continuation and
+ <code>bThrowOnAbort</code> is <TRUE/>;</li>
+ <li>a <type scope="com::sun::star::uno">RuntimeException</type> if such an
+ exception is thrown by code called from within this function.</li>
+ </ul>
+ */
+namespace ucbhelper {
+
+std::pair< sal_Int32,
+ rtl::Reference< ucbhelper::InteractionSupplyAuthentication > >
+handleInteractionRequest(
+ rtl::Reference< ucbhelper::SimpleAuthenticationRequest > const & rRequest,
+ com::sun::star::uno::Reference<
+ com::sun::star::ucb::XCommandEnvironment > const &
+ rEnvironment,
+ bool bThrowOnAbort = true)
+ SAL_THROW((com::sun::star::uno::Exception));
+
+}
+
+/** Pass a <type scope="ucbhelper">SimpleCertificateValidationRequest</type> to an
+ <type scope="com::sun::star::task">XInteractionHandler</type>, and handle
+ (by throwing the request as an exception) those cases where an interaction
+ handler is either not available or does not handle the request.
+
+ @param rRequest
+ a <type scope="ucbhelper">SimpleCertificateValidationRequest</type>. Must not be
+ <NULL/>.
+
+ @param rEnvironment
+ At the moment, only the
+ <type scope="com::sun::star::task">XInteractionHandler</type> part is
+ used. May be <NULL/>.
+
+ @param bThrowOnAbort
+ determines what is done if the interaction handler selects a
+ <const scope="ucbhelper">CONTINUATION_ABORT</const> continuation: If
+ <TRUE/>, an appropriate
+ <type scope="com::sun::star::ucb">CommandFailedException</type> is thrown.
+ If <FALSE/>, <const scope="ucbhelper">CONTINUATION_ABORT</const> is passed
+ to the caller of this function.
+
+ @returns
+ the constant (defined in ucbhelper/simpelinteractionrequest.hxx) that
+ corresponds to the continuation selected by the interaction handler.
+ The constant <const scope="ucbhelper">CONTINUATION_UNKNOWN</const> will
+ never be returned.
+
+ @throws
+ <ul>
+ <li>the exception specified by the request, if an interaction handler is
+ either not available or does not handle the request;</li>
+ <li>a <type scope="com::sun::star::ucb">CommandFailedException</type> if
+ the interaction handler selects a
+ <const scope="ucbhelper">CONTINUATION_ABORT</const> continuation and
+ <code>bThrowOnAbort</code> is <TRUE/>;</li>
+ <li>a <type scope="com::sun::star::uno">RuntimeException</type> if such an
+ exception is thrown by code called from within this function.</li>
+ </ul>
+ */
+namespace ucbhelper {
+
+sal_Int32
+handleInteractionRequest(
+ rtl::Reference< ucbhelper::SimpleCertificateValidationRequest > const & rRequest,
+ com::sun::star::uno::Reference<
+ com::sun::star::ucb::XCommandEnvironment > const &
+ rEnvironment,
+ bool bThrowOnAbort = true)
+ SAL_THROW((com::sun::star::uno::Exception));
+
+}
+#endif // INCLUDED_UCBHELPER_HANDLEINTERACTIONREQUEST_HXX
diff --git a/ucbhelper/inc/ucbhelper/interactionrequest.hxx b/ucbhelper/inc/ucbhelper/interactionrequest.hxx
new file mode 100644
index 000000000000..197abb36ea34
--- /dev/null
+++ b/ucbhelper/inc/ucbhelper/interactionrequest.hxx
@@ -0,0 +1,727 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef _UCBHELPER_INTERATIONREQUEST_HXX
+#define _UCBHELPER_INTERATIONREQUEST_HXX
+
+#include <com/sun/star/lang/XTypeProvider.hpp>
+#include <com/sun/star/task/XInteractionRequest.hpp>
+#include <com/sun/star/task/XInteractionAbort.hpp>
+#include <com/sun/star/task/XInteractionRetry.hpp>
+#include <com/sun/star/task/XInteractionApprove.hpp>
+#include <com/sun/star/task/XInteractionDisapprove.hpp>
+#include <com/sun/star/ucb/XInteractionReplaceExistingData.hpp>
+#include <com/sun/star/ucb/XInteractionSupplyAuthentication2.hpp>
+#include <com/sun/star/ucb/XInteractionSupplyName.hpp>
+#include <rtl/ref.hxx>
+#include <cppuhelper/weak.hxx>
+#include "ucbhelper/ucbhelperdllapi.h"
+
+namespace ucbhelper {
+
+class InteractionContinuation;
+
+//============================================================================
+struct InteractionRequest_Impl;
+
+/**
+ * This class implements the interface XInteractionRequest. Instances can
+ * be passed directly to XInteractionHandler::handle(...). Each interaction
+ * request contains an exception describing the error and a number of
+ * interaction continuations describing the possible "answers" for the request.
+ * After the request was passed to XInteractionHandler::handle(...) the method
+ * getSelection() returns the continuation choosen by the interaction handler.
+ *
+ * The typical usage of this class would be:
+ *
+ * 1) Create exception object that shall be handled by the interaction handler.
+ * 2) Create InteractionRequest, supply exception as ctor parameter
+ * 3) Create continuations needed and add them to a sequence
+ * 4) Supply the continuations to the InteractionRequest by calling
+ * setContinuations(...)
+ *
+ * This class can also be used as base class for more specialized requests,
+ * like authentication requests.
+ */
+class UCBHELPER_DLLPUBLIC InteractionRequest : public cppu::OWeakObject,
+ public com::sun::star::lang::XTypeProvider,
+ public com::sun::star::task::XInteractionRequest
+{
+ InteractionRequest_Impl * m_pImpl;
+
+protected:
+ void setRequest( const com::sun::star::uno::Any & rRequest );
+
+ InteractionRequest();
+ virtual ~InteractionRequest();
+
+public:
+ /**
+ * Constructor.
+ *
+ * @param rRequest is the exception describing the error.
+ */
+ InteractionRequest( const com::sun::star::uno::Any & rRequest );
+
+ /**
+ * This method sets the continuations for the request.
+ *
+ * @param rContinuations contains the possible continuations.
+ */
+ void setContinuations(
+ const com::sun::star::uno::Sequence<
+ com::sun::star::uno::Reference<
+ com::sun::star::task::XInteractionContinuation > > &
+ rContinuations );
+
+ // XInterface
+ virtual com::sun::star::uno::Any SAL_CALL
+ queryInterface( const com::sun::star::uno::Type & rType )
+ throw( com::sun::star::uno::RuntimeException );
+ virtual void SAL_CALL acquire()
+ throw();
+ virtual void SAL_CALL release()
+ throw();
+
+ // XTypeProvider
+ virtual com::sun::star::uno::Sequence< com::sun::star::uno::Type > SAL_CALL
+ getTypes()
+ throw( com::sun::star::uno::RuntimeException );
+ virtual com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL
+ getImplementationId()
+ throw( com::sun::star::uno::RuntimeException );
+
+ // XInteractionRequest
+ virtual com::sun::star::uno::Any SAL_CALL
+ getRequest()
+ throw( com::sun::star::uno::RuntimeException );
+ virtual com::sun::star::uno::Sequence<
+ com::sun::star::uno::Reference<
+ com::sun::star::task::XInteractionContinuation > > SAL_CALL
+ getContinuations()
+ throw( com::sun::star::uno::RuntimeException );
+
+ // Non-interface methods.
+
+ /**
+ * After passing this request to XInteractionHandler::handle, this method
+ * returns the continuation that was choosen by the interaction handler.
+ *
+ * @return the continuation choosen by an interaction handler or an empty
+ * reference, if the request was not (yet) handled.
+ */
+ rtl::Reference< InteractionContinuation > getSelection() const;
+
+ /**
+ * This method sets a continuation for the request. It also can be used
+ * to reset the continuation set by a previous XInteractionHandler::handle
+ * call in order to use this request object more then once.
+ *
+ * @param rxSelection is the interaction continuation to activate for
+ * the request or an empty reference in order to reset the
+ * current selection.
+ */
+ void
+ setSelection(
+ const rtl::Reference< InteractionContinuation > & rxSelection );
+};
+
+//============================================================================
+struct InteractionContinuation_Impl;
+
+/**
+ * This class is the base for implementations of the interface
+ * XInteractionContinuation. Classes derived from this bas class work together
+ * with class InteractionRequest.
+ *
+ * Derived classes must implement their XInteractionContinuation::select()
+ * method the way that they simply call recordSelection() which is provided by
+ * this class.
+ */
+class UCBHELPER_DLLPUBLIC InteractionContinuation : public cppu::OWeakObject
+{
+ InteractionContinuation_Impl * m_pImpl;
+
+protected:
+ /**
+ * This method marks this continuation as "selected" at the request it
+ * belongs to.
+ *
+ * Derived classes must implement their XInteractionContinuation::select()
+ * method the way that they call this method.
+ */
+ void recordSelection();
+ virtual ~InteractionContinuation();
+
+public:
+ InteractionContinuation( InteractionRequest * pRequest );
+};
+
+//============================================================================
+/**
+ * This class implements a standard interaction continuation, namely the
+ * interface XInteractionAbort. Instances of this class can be passed
+ * along with an interaction request to indicate the possiblity to abort
+ * the operation that caused the request.
+ */
+class UCBHELPER_DLLPUBLIC InteractionAbort : public InteractionContinuation,
+ public com::sun::star::lang::XTypeProvider,
+ public com::sun::star::task::XInteractionAbort
+{
+public:
+ InteractionAbort( InteractionRequest * pRequest )
+ : InteractionContinuation( pRequest ) {}
+
+ // XInterface
+ virtual com::sun::star::uno::Any SAL_CALL
+ queryInterface( const com::sun::star::uno::Type & rType )
+ throw( com::sun::star::uno::RuntimeException );
+ virtual void SAL_CALL acquire()
+ throw();
+ virtual void SAL_CALL release()
+ throw();
+
+ // XTypeProvider
+ virtual com::sun::star::uno::Sequence< com::sun::star::uno::Type > SAL_CALL
+ getTypes()
+ throw( com::sun::star::uno::RuntimeException );
+ virtual com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL
+ getImplementationId()
+ throw( com::sun::star::uno::RuntimeException );
+
+ // XInteractionContinuation
+ virtual void SAL_CALL select()
+ throw( com::sun::star::uno::RuntimeException );
+};
+
+//============================================================================
+/**
+ * This class implements a standard interaction continuation, namely the
+ * interface XInteractionRetry. Instances of this class can be passed
+ * along with an interaction request to indicate the possiblity to retry
+ * the operation that caused the request.
+ */
+class UCBHELPER_DLLPUBLIC InteractionRetry : public InteractionContinuation,
+ public com::sun::star::lang::XTypeProvider,
+ public com::sun::star::task::XInteractionRetry
+{
+public:
+ InteractionRetry( InteractionRequest * pRequest )
+ : InteractionContinuation( pRequest ) {}
+
+ // XInterface
+ virtual com::sun::star::uno::Any SAL_CALL
+ queryInterface( const com::sun::star::uno::Type & rType )
+ throw( com::sun::star::uno::RuntimeException );
+ virtual void SAL_CALL acquire()
+ throw();
+ virtual void SAL_CALL release()
+ throw();
+
+ // XTypeProvider
+ virtual com::sun::star::uno::Sequence< com::sun::star::uno::Type > SAL_CALL
+ getTypes()
+ throw( com::sun::star::uno::RuntimeException );
+ virtual com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL
+ getImplementationId()
+ throw( com::sun::star::uno::RuntimeException );
+
+ // XInteractionContinuation
+ virtual void SAL_CALL select()
+ throw( com::sun::star::uno::RuntimeException );
+};
+
+//============================================================================
+/**
+ * This class implements a standard interaction continuation, namely the
+ * interface XInteractionApprove. Instances of this class can be passed
+ * along with an interaction request to indicate the possiblity to approve
+ * the request.
+ */
+class UCBHELPER_DLLPUBLIC InteractionApprove : public InteractionContinuation,
+ public com::sun::star::lang::XTypeProvider,
+ public com::sun::star::task::XInteractionApprove
+{
+public:
+ InteractionApprove( InteractionRequest * pRequest )
+ : InteractionContinuation( pRequest ) {}
+
+ // XInterface
+ virtual com::sun::star::uno::Any SAL_CALL
+ queryInterface( const com::sun::star::uno::Type & rType )
+ throw( com::sun::star::uno::RuntimeException );
+ virtual void SAL_CALL acquire()
+ throw();
+ virtual void SAL_CALL release()
+ throw();
+
+ // XTypeProvider
+ virtual com::sun::star::uno::Sequence< com::sun::star::uno::Type > SAL_CALL
+ getTypes()
+ throw( com::sun::star::uno::RuntimeException );
+ virtual com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL
+ getImplementationId()
+ throw( com::sun::star::uno::RuntimeException );
+
+ // XInteractionContinuation
+ virtual void SAL_CALL select()
+ throw( com::sun::star::uno::RuntimeException );
+};
+
+//============================================================================
+/**
+ * This class implements a standard interaction continuation, namely the
+ * interface XInteractionDisapprove. Instances of this class can be passed
+ * along with an interaction request to indicate the possiblity to disapprove
+ * the request.
+ */
+class UCBHELPER_DLLPUBLIC InteractionDisapprove : public InteractionContinuation,
+ public com::sun::star::lang::XTypeProvider,
+ public com::sun::star::task::XInteractionDisapprove
+{
+public:
+ InteractionDisapprove( InteractionRequest * pRequest )
+ : InteractionContinuation( pRequest ) {}
+
+ // XInterface
+ virtual com::sun::star::uno::Any SAL_CALL
+ queryInterface( const com::sun::star::uno::Type & rType )
+ throw( com::sun::star::uno::RuntimeException );
+ virtual void SAL_CALL acquire()
+ throw();
+ virtual void SAL_CALL release()
+ throw();
+
+ // XTypeProvider
+ virtual com::sun::star::uno::Sequence< com::sun::star::uno::Type > SAL_CALL
+ getTypes()
+ throw( com::sun::star::uno::RuntimeException );
+ virtual com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL
+ getImplementationId()
+ throw( com::sun::star::uno::RuntimeException );
+
+ // XInteractionContinuation
+ virtual void SAL_CALL select()
+ throw( com::sun::star::uno::RuntimeException );
+};
+
+//============================================================================
+/**
+ * This class implements a standard interaction continuation, namely the
+ * interface XInteractionSupplyAuthentication. Instances of this class can be
+ * passed along with an authentication interaction request to enable the
+ * interaction handler to supply the missing authentication data.
+ */
+class UCBHELPER_DLLPUBLIC InteractionSupplyAuthentication :
+ public InteractionContinuation,
+ public com::sun::star::lang::XTypeProvider,
+ public com::sun::star::ucb::XInteractionSupplyAuthentication2
+{
+ com::sun::star::uno::Sequence< com::sun::star::ucb::RememberAuthentication >
+ m_aRememberPasswordModes;
+ com::sun::star::uno::Sequence< com::sun::star::ucb::RememberAuthentication >
+ m_aRememberAccountModes;
+ rtl::OUString m_aRealm;
+ rtl::OUString m_aUserName;
+ rtl::OUString m_aPassword;
+ rtl::OUString m_aAccount;
+ com::sun::star::ucb::RememberAuthentication m_eRememberPasswordMode;
+ com::sun::star::ucb::RememberAuthentication m_eDefaultRememberPasswordMode;
+ com::sun::star::ucb::RememberAuthentication m_eRememberAccountMode;
+ com::sun::star::ucb::RememberAuthentication m_eDefaultRememberAccountMode;
+ unsigned m_bCanSetRealm : 1;
+ unsigned m_bCanSetUserName : 1;
+ unsigned m_bCanSetPassword : 1;
+ unsigned m_bCanSetAccount : 1;
+ unsigned m_bCanUseSystemCredentials : 1;
+ unsigned m_bDefaultUseSystemCredentials : 1;
+ unsigned m_bUseSystemCredentials : 1;
+
+public:
+ /**
+ * Constructor.
+ *
+ * @param rxRequest is the interaction request that owns this continuation.
+ * @param bCanSetRealm indicates, whether the realm given with the
+ * authentication request is read-only.
+ * @param bCanSetUserName indicates, whether the username given with the
+ * authentication request is read-only.
+ * @param bCanSetPassword indicates, whether the password given with the
+ * authentication request is read-only.
+ * @param bCanSetAccount indicates, whether the account given with the
+ * authentication request is read-only.
+ *
+ * @see com::sun::star::ucb::AuthenticationRequest
+ */
+ inline InteractionSupplyAuthentication(
+ InteractionRequest * pRequest,
+ sal_Bool bCanSetRealm,
+ sal_Bool bCanSetUserName,
+ sal_Bool bCanSetPassword,
+ sal_Bool bCanSetAccount);
+ /**
+ * Constructor.
+ *
+ * Note: The remember-authentication stuff is interesting only for
+ * clients implementing own password storage functionality.
+ *
+ * @param rxRequest is the interaction request that owns this continuation.
+ * @param bCanSetRealm indicates, whether the realm given with the
+ * authentication request is read-only.
+ * @param bCanSetUserName indicates, whether the username given with the
+ * authentication request is read-only.
+ * @param bCanSetPassword indicates, whether the password given with the
+ * authentication request is read-only.
+ * @param bCanSetAccount indicates, whether the account given with the
+ * authentication request is read-only.
+ * @param rRememberPasswordModes specifies the authentication-remember-
+ * modes for passwords supported by the requesting client.
+ * @param eDefaultRememberPasswordMode specifies the default
+ * authentication-remember-mode for passwords preferred by the
+ * requesting client.
+ * @param rRememberAccountModes specifies the authentication-remember-
+ * modes for accounts supported by the requesting client.
+ * @param eDefaultRememberAccountMode specifies the default
+ * authentication-remember-mode for accounts preferred by the
+ * requesting client.
+ * @param bCanUseSystemCredentials indicates whether issuer of the
+ * authetication request can obtain and use system credentials
+ * for authentication.
+ * @param bDefaultUseSystemCredentials specifies the default system
+ * credentials usage preferred by the requesting client
+ *
+ * @see com::sun::star::ucb::AuthenticationRequest
+ * @see com::sun::star::ucb::RememberAuthentication
+ */
+ inline InteractionSupplyAuthentication(
+ InteractionRequest * pRequest,
+ sal_Bool bCanSetRealm,
+ sal_Bool bCanSetUserName,
+ sal_Bool bCanSetPassword,
+ sal_Bool bCanSetAccount,
+ const com::sun::star::uno::Sequence<
+ com::sun::star::ucb::RememberAuthentication > &
+ rRememberPasswordModes,
+ const com::sun::star::ucb::RememberAuthentication
+ eDefaultRememberPasswordMode,
+ const com::sun::star::uno::Sequence<
+ com::sun::star::ucb::RememberAuthentication > &
+ rRememberAccountModes,
+ const com::sun::star::ucb::RememberAuthentication
+ eDefaultRememberAccountMode,
+ sal_Bool bCanUseSystemCredentials,
+ sal_Bool bDefaultUseSystemCredentials );
+
+ // XInterface
+ virtual com::sun::star::uno::Any SAL_CALL
+ queryInterface( const com::sun::star::uno::Type & rType )
+ throw( com::sun::star::uno::RuntimeException );
+ virtual void SAL_CALL acquire()
+ throw();
+ virtual void SAL_CALL release()
+ throw();
+
+ // XTypeProvider
+ virtual com::sun::star::uno::Sequence< com::sun::star::uno::Type > SAL_CALL
+ getTypes()
+ throw( com::sun::star::uno::RuntimeException );
+ virtual com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL
+ getImplementationId()
+ throw( com::sun::star::uno::RuntimeException );
+
+ // XInteractionContinuation
+ virtual void SAL_CALL select()
+ throw( com::sun::star::uno::RuntimeException );
+
+ // XInteractionSupplyAuthentication
+ virtual sal_Bool SAL_CALL
+ canSetRealm()
+ throw( com::sun::star::uno::RuntimeException );
+ virtual void SAL_CALL
+ setRealm( const rtl::OUString& Realm )
+ throw( com::sun::star::uno::RuntimeException );
+
+ virtual sal_Bool SAL_CALL
+ canSetUserName()
+ throw( com::sun::star::uno::RuntimeException );
+ virtual void SAL_CALL
+ setUserName( const rtl::OUString& UserName )
+ throw( com::sun::star::uno::RuntimeException );
+
+ virtual sal_Bool SAL_CALL
+ canSetPassword()
+ throw( com::sun::star::uno::RuntimeException );
+ virtual void SAL_CALL
+ setPassword( const rtl::OUString& Password )
+ throw( com::sun::star::uno::RuntimeException );
+
+ virtual com::sun::star::uno::Sequence<
+ com::sun::star::ucb::RememberAuthentication > SAL_CALL
+ getRememberPasswordModes(
+ com::sun::star::ucb::RememberAuthentication& Default )
+ throw( com::sun::star::uno::RuntimeException );
+ virtual void SAL_CALL
+ setRememberPassword( com::sun::star::ucb::RememberAuthentication Remember )
+ throw( com::sun::star::uno::RuntimeException );
+
+ virtual sal_Bool SAL_CALL
+ canSetAccount()
+ throw( com::sun::star::uno::RuntimeException );
+ virtual void SAL_CALL
+ setAccount( const rtl::OUString& Account )
+ throw( com::sun::star::uno::RuntimeException );
+
+ virtual com::sun::star::uno::Sequence<
+ com::sun::star::ucb::RememberAuthentication > SAL_CALL
+ getRememberAccountModes(
+ com::sun::star::ucb::RememberAuthentication& Default )
+ throw( com::sun::star::uno::RuntimeException );
+ virtual void SAL_CALL
+ setRememberAccount( com::sun::star::ucb::RememberAuthentication Remember )
+ throw( com::sun::star::uno::RuntimeException );
+
+ // XInteractionSupplyAuthentication2
+ virtual ::sal_Bool SAL_CALL canUseSystemCredentials( ::sal_Bool& Default )
+ throw ( ::com::sun::star::uno::RuntimeException );
+ virtual void SAL_CALL setUseSystemCredentials( ::sal_Bool UseSystemCredentials )
+ throw ( ::com::sun::star::uno::RuntimeException );
+
+ // Non-interface methods.
+
+ /**
+ * This method returns the realm that was supplied by the interaction
+ * handler.
+ *
+ * @return the realm.
+ */
+ const rtl::OUString & getRealm() const { return m_aRealm; }
+
+ /**
+ * This method returns the username that was supplied by the interaction
+ * handler.
+ *
+ * @return the username.
+ */
+ const rtl::OUString & getUserName() const { return m_aUserName; }
+
+ /**
+ * This method returns the password that was supplied by the interaction
+ * handler.
+ *
+ * @return the password.
+ */
+ const rtl::OUString & getPassword() const { return m_aPassword; }
+
+ /**
+ * This method returns the account that was supplied by the interaction
+ * handler.
+ *
+ * @return the account.
+ */
+ const rtl::OUString & getAccount() const { return m_aAccount; }
+
+ /**
+ * This method returns the authentication remember-mode for the password
+ * that was supplied by the interaction handler.
+ *
+ * @return the remember-mode for the password.
+ */
+ const com::sun::star::ucb::RememberAuthentication &
+ getRememberPasswordMode() const { return m_eRememberPasswordMode; }
+
+ /**
+ * This method returns the authentication remember-mode for the account
+ * that was supplied by the interaction handler.
+ *
+ * @return the remember-mode for the account.
+ */
+ const com::sun::star::ucb::RememberAuthentication &
+ getRememberAccountMode() const { return m_eRememberAccountMode; }
+
+ sal_Bool getUseSystemCredentials() const { return m_bUseSystemCredentials; }
+};
+
+//============================================================================
+inline InteractionSupplyAuthentication::InteractionSupplyAuthentication(
+ InteractionRequest * pRequest,
+ sal_Bool bCanSetRealm,
+ sal_Bool bCanSetUserName,
+ sal_Bool bCanSetPassword,
+ sal_Bool bCanSetAccount )
+: InteractionContinuation( pRequest ),
+ m_aRememberPasswordModes( com::sun::star::uno::Sequence<
+ com::sun::star::ucb::RememberAuthentication >( 1 ) ),
+ m_aRememberAccountModes( com::sun::star::uno::Sequence<
+ com::sun::star::ucb::RememberAuthentication >( 1 ) ),
+ m_eRememberPasswordMode( com::sun::star::ucb::RememberAuthentication_NO ),
+ m_eDefaultRememberPasswordMode(
+ com::sun::star::ucb::RememberAuthentication_NO ),
+ m_eRememberAccountMode( com::sun::star::ucb::RememberAuthentication_NO ),
+ m_eDefaultRememberAccountMode(
+ com::sun::star::ucb::RememberAuthentication_NO ),
+ m_bCanSetRealm( bCanSetRealm ),
+ m_bCanSetUserName( bCanSetUserName ),
+ m_bCanSetPassword( bCanSetPassword ),
+ m_bCanSetAccount( bCanSetAccount ),
+ m_bCanUseSystemCredentials( sal_False ),
+ m_bDefaultUseSystemCredentials( sal_False ),
+ m_bUseSystemCredentials( sal_False )
+{
+ m_aRememberPasswordModes[ 0 ]
+ = com::sun::star::ucb::RememberAuthentication_NO;
+ m_aRememberAccountModes [ 0 ]
+ = com::sun::star::ucb::RememberAuthentication_NO;
+}
+
+//============================================================================
+inline InteractionSupplyAuthentication::InteractionSupplyAuthentication(
+ InteractionRequest * pRequest,
+ sal_Bool bCanSetRealm,
+ sal_Bool bCanSetUserName,
+ sal_Bool bCanSetPassword,
+ sal_Bool bCanSetAccount,
+ const com::sun::star::uno::Sequence<
+ com::sun::star::ucb::RememberAuthentication > & rRememberPasswordModes,
+ const com::sun::star::ucb::RememberAuthentication
+ eDefaultRememberPasswordMode,
+ const com::sun::star::uno::Sequence<
+ com::sun::star::ucb::RememberAuthentication > & rRememberAccountModes,
+ const com::sun::star::ucb::RememberAuthentication
+ eDefaultRememberAccountMode,
+ sal_Bool bCanUseSystemCredentials,
+ sal_Bool bDefaultUseSystemCredentials )
+: InteractionContinuation( pRequest ),
+ m_aRememberPasswordModes( rRememberPasswordModes ),
+ m_aRememberAccountModes( rRememberAccountModes ),
+ m_eRememberPasswordMode( eDefaultRememberPasswordMode ),
+ m_eDefaultRememberPasswordMode( eDefaultRememberPasswordMode ),
+ m_eRememberAccountMode( eDefaultRememberAccountMode ),
+ m_eDefaultRememberAccountMode( eDefaultRememberAccountMode ),
+ m_bCanSetRealm( bCanSetRealm ),
+ m_bCanSetUserName( bCanSetUserName ),
+ m_bCanSetPassword( bCanSetPassword ),
+ m_bCanSetAccount( bCanSetAccount ),
+ m_bCanUseSystemCredentials( bCanUseSystemCredentials ),
+ m_bDefaultUseSystemCredentials( bDefaultUseSystemCredentials ),
+ m_bUseSystemCredentials( bDefaultUseSystemCredentials & bCanUseSystemCredentials )
+{
+}
+
+//============================================================================
+/**
+ * This class implements a standard interaction continuation, namely the
+ * interface XInteractionSupplyName. Instances of this class can be passed
+ * along with an interaction request to indicate the possiblity to
+ * supply a new name.
+ */
+class InteractionSupplyName : public InteractionContinuation,
+ public com::sun::star::lang::XTypeProvider,
+ public com::sun::star::ucb::XInteractionSupplyName
+{
+ rtl::OUString m_aName;
+
+public:
+ InteractionSupplyName( InteractionRequest * pRequest )
+ : InteractionContinuation( pRequest ) {}
+
+ // XInterface
+ virtual com::sun::star::uno::Any SAL_CALL
+ queryInterface( const com::sun::star::uno::Type & rType )
+ throw( com::sun::star::uno::RuntimeException );
+ virtual void SAL_CALL acquire()
+ throw();
+ virtual void SAL_CALL release()
+ throw();
+
+ // XTypeProvider
+ virtual com::sun::star::uno::Sequence< com::sun::star::uno::Type > SAL_CALL
+ getTypes()
+ throw( com::sun::star::uno::RuntimeException );
+ virtual com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL
+ getImplementationId()
+ throw( com::sun::star::uno::RuntimeException );
+
+ // XInteractionContinuation
+ virtual void SAL_CALL select()
+ throw( com::sun::star::uno::RuntimeException );
+
+ // XInteractionSupplyName
+ virtual void SAL_CALL setName( const ::rtl::OUString& Name )
+ throw ( com::sun::star::uno::RuntimeException );
+
+ // Non-interface methods.
+
+ /**
+ * This method returns the name that was supplied by the interaction
+ * handler.
+ *
+ * @return the name.
+ */
+ const rtl::OUString & getName() const { return m_aName; }
+};
+
+//============================================================================
+/**
+ * This class implements a standard interaction continuation, namely the
+ * interface XInteractionReplaceExistingData. Instances of this class can be
+ * passed along with an interaction request to indicate the possiblity to
+ * replace existing data.
+ */
+class InteractionReplaceExistingData :
+ public InteractionContinuation,
+ public com::sun::star::lang::XTypeProvider,
+ public com::sun::star::ucb::XInteractionReplaceExistingData
+{
+public:
+ InteractionReplaceExistingData( InteractionRequest * pRequest )
+ : InteractionContinuation( pRequest ) {}
+
+ // XInterface
+ virtual com::sun::star::uno::Any SAL_CALL
+ queryInterface( const com::sun::star::uno::Type & rType )
+ throw( com::sun::star::uno::RuntimeException );
+ virtual void SAL_CALL acquire()
+ throw();
+ virtual void SAL_CALL release()
+ throw();
+
+ // XTypeProvider
+ virtual com::sun::star::uno::Sequence< com::sun::star::uno::Type > SAL_CALL
+ getTypes()
+ throw( com::sun::star::uno::RuntimeException );
+ virtual com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL
+ getImplementationId()
+ throw( com::sun::star::uno::RuntimeException );
+
+ // XInteractionContinuation
+ virtual void SAL_CALL select()
+ throw( com::sun::star::uno::RuntimeException );
+};
+
+} // namespace ucbhelper
+
+#endif /* !_UCBHELPER_INTERATIONREQUEST_HXX */
diff --git a/ucbhelper/inc/ucbhelper/interceptedinteraction.hxx b/ucbhelper/inc/ucbhelper/interceptedinteraction.hxx
new file mode 100644
index 000000000000..23ed0fb4d60b
--- /dev/null
+++ b/ucbhelper/inc/ucbhelper/interceptedinteraction.hxx
@@ -0,0 +1,351 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef _UCBHELPER_INTERCEPTEDINTERACTION_HXX_
+#define _UCBHELPER_INTERCEPTEDINTERACTION_HXX_
+
+//_______________________________________________
+// includes
+
+#include <vector>
+
+#ifndef __COM_SUN_STAR_TASK_XINTERACTIONHANDLER_HPP__
+#include <com/sun/star/task/XInteractionHandler.hpp>
+#endif
+
+#ifndef __COM_SUN_STAR_TASK_XINTERACTIONREQUEST_HPP__
+#include <com/sun/star/task/XInteractionRequest.hpp>
+#endif
+#include <cppuhelper/implbase1.hxx>
+#include "ucbhelper/ucbhelperdllapi.h"
+
+//_______________________________________________
+// namespace
+
+namespace ucbhelper{
+
+//_______________________________________________
+// definitions
+
+/** @short it wraps any other interaction handler and intercept
+ its handle() requests.
+
+ @descr This class can be used as:
+ - instance if special interactions must be supressed
+ only
+ - or as base class if interactions must be modified.
+ */
+class UCBHELPER_DLLPUBLIC InterceptedInteraction : public ::cppu::WeakImplHelper1< ::com::sun::star::task::XInteractionHandler >
+{
+ //-------------------------------------------
+ // types
+ public:
+
+ struct InterceptedRequest
+ {
+ //-----------------------------------
+ /** @short marks an Handle as invalid.
+ */
+ static const sal_Int32 INVALID_HANDLE = -1;
+
+ //-----------------------------------
+ /** @short contains the interaction request, which should be intercepted. */
+ ::com::sun::star::uno::Any Request;
+
+ //-----------------------------------
+ /** @short specify the fix continuation, which must be selected, if the
+ interaction could be intercepted successfully.
+ */
+ ::com::sun::star::uno::Type Continuation;
+
+ //-----------------------------------
+ /** @short specify, if both interactions must have the same type
+ or can be derived from.
+
+ @descr Interaction base on exceptions - and exceptions are real types.
+ So they can be checked in its type. These parameter "MatchExact"
+ influence the type-check in the following way:
+ TRUE => the exception will be intercepted only
+ if it supports exactly the same type ...
+ or
+ FALSE => derived exceptions will be intercepted too.
+
+ @attention This parameter does not influence the check of the continuation
+ type! The continuation must be matched exactly everytimes ...
+ */
+ sal_Bool MatchExact;
+
+ //-----------------------------------
+ /** @short its an unique identifier, which must be managed by the outside code.
+
+ @descr If there is a derived class, which overwrites the InterceptedInteraction::intercepted()
+ method, it will be called with a reference to an InterceptedRequest struct.
+ Then it can use the handle to react without checking the request type again.
+ */
+ sal_Int32 Handle;
+
+ //-----------------------------------
+ /** @short default ctor.
+
+ @descr Such constructed object cant be used realy.
+ Might it will crash if its used!
+ Dont forget to initialize all(!) members ...
+ */
+ InterceptedRequest()
+ {
+ MatchExact = sal_False;
+ Handle = INVALID_HANDLE;
+ }
+
+ //-----------------------------------
+ /** @short initialize this instance.
+
+ @param nHandle
+ used to identify every intercepted request
+
+ @param aRequest
+ must contain an exception object, which can be checked
+ in its uno-type against the later handled interaction.
+
+ @param aContinuation
+ must contain a continuation object, which is used
+ in its uno-type to locate the same continuation
+ inside the list of possible ones.
+
+ @param bMatchExact
+ influence the type check of the interception request.
+ Its not used to check the continuation!
+ */
+ InterceptedRequest( sal_Int32 nHandle ,
+ const ::com::sun::star::uno::Any& aRequest ,
+ const ::com::sun::star::uno::Type& aContinuation,
+ sal_Bool bMatchExact )
+ {
+ Handle = nHandle;
+ Request = aRequest;
+ Continuation = aContinuation;
+ MatchExact = bMatchExact;
+ }
+ };
+
+ //---------------------------------------
+ /** @short represent the different states, which can occure
+ as result of an interception.
+
+ @see impl_interceptRequest()
+ */
+ enum EInterceptionState
+ {
+ /** none of the specified interceptions match the incoming request */
+ E_NOT_INTERCEPTED,
+ /** the request could be intercepted - but the specified continuation could not be located.
+ Thats normaly an error of the programmer. May be the interaction request does not use
+ the right set of continuations ... or the interception list contains the wrong continuation. */
+ E_NO_CONTINUATION_FOUND,
+ /** the request could be intercepted and the specified continuation could be selected successfully. */
+ E_INTERCEPTED
+ };
+
+ //-------------------------------------------
+ // member
+ protected:
+
+ //---------------------------------------
+ /** @short reference to the intercepted interaction handler.
+
+ @descr NULL is allowed for this member!
+ All interaction will be aborted then ...
+ expecting th handle() was overwritten by
+ a derived class.
+ */
+ ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionHandler > m_xInterceptedHandler;
+
+ //---------------------------------------
+ /** @short these list contains the requests, which should be intercepted.
+ */
+ ::std::vector< InterceptedRequest > m_lInterceptions;
+
+ //-------------------------------------------
+ // native interface
+ public:
+
+ //---------------------------------------
+ /** @short initialize a new instance with default values.
+ */
+ InterceptedInteraction();
+
+ //---------------------------------------
+ /** @short initialize a new instance with real values.
+
+ @param xInterceptedHandler
+ the outside interaction handler, which should
+ be intercepted here.
+
+ @param lInterceptions
+ the list of intercepted requests.
+ */
+ InterceptedInteraction(const ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionHandler >& xInterceptedHandler,
+ const ::std::vector< InterceptedRequest >& lInterceptions );
+
+ //---------------------------------------
+ /** @short initialize a new instance with the interaction handler,
+ which should be intercepted.
+
+ @attention If such interaction handler isnt set here,
+ all incoming requests will be aborted ...
+ if the right continuation is available!
+
+ @param xInterceptedHandler
+ the outside interaction handler, which should
+ be intercepted here.
+ */
+ void setInterceptedHandler(const ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionHandler >& xInterceptedHandler);
+
+ //---------------------------------------
+ /** @short set a new list of intercepted interactions.
+
+ @attention If the interface method handle() will be overwritten by
+ a derived class, the functionality behind these static list
+ cant be used.
+
+ @param lInterceptions
+ the list of intercepted requests.
+ */
+ void setInterceptions(const ::std::vector< InterceptedRequest >& lInterceptions);
+
+ //---------------------------------------
+ /** @short extract a requested continuation from te list of available ones.
+
+ @param lContinuations
+ the list of available continuations.
+
+ @param aType
+ is used to locate the right continuation,
+ by checking its interface type.
+
+ @return A valid reference to the continuation, if it could be located ...
+ or an empty reference otherwhise.
+ */
+ static ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionContinuation > extractContinuation(
+ const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionContinuation > >& lContinuations,
+ const ::com::sun::star::uno::Type& aType );
+
+ //-------------------------------------------
+ // useable for derived classes
+ protected:
+
+ //---------------------------------------
+ /** @short can be overwritten by a derived class to handle interceptions
+ outside.
+
+ @descr This base implementation checks, if the request could be intercepted
+ successfully. Then this method intercepted() is called.
+ The default implementation returns "NOT_INTERCEPTED" everytimes.
+ So the method impl_interceptRequest() uses the right continuation automaticly.
+
+ If this method was overwritten and something different "NO_INTERCEPTED"
+ is returned, the method impl_interceptRequest() will return immediatly with
+ the result, which is returned by this intercepted() method.
+ Then the continuations must be selected inside the intercepted() call!
+
+ @param rRequest
+ it points to the intercepted request (means the item of the
+ set interception list). e.g. its "Handle" member can be used
+ to identify it and react very easy, without the need to check the
+ type of the exception ...
+
+ @param xOrgRequest
+ points to the original interaction, which was intercepted.
+ It provides access to the exception and the list of possible
+ continuations.
+
+ @return The result of this operation.
+ Note: If E_NOT_INTERCEPTED is returned the default handling of the base class
+ will be used automaticly for this request!
+ */
+ virtual EInterceptionState intercepted(const InterceptedRequest& rRequest ,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionRequest >& xOrgRequest);
+
+ //-------------------------------------------
+ // uno interface
+ public:
+
+ //---------------------------------------
+ /** @short implements the default handling of this class ....
+ or can be overwritten by any derived class.
+
+ @descr If no further class is derived from this one
+ -> the default implementation is used. Then the
+ internal list of requests is used to handle different
+ interactions automaticly.
+ (see impl_interceptRequest())
+
+ If this method was overwritten by a derived implementation
+ -> the new implementation has to do everything by itself.
+ Of course it can access all members/helpers and work with it.
+ But the default implementation isnt used automaticly then.
+
+ @param xRequest
+ the interaction request, which should be intercepted.
+ */
+ virtual void SAL_CALL handle(const ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionRequest >& xRequest)
+ throw(::com::sun::star::uno::RuntimeException);
+
+ //-------------------------------------------
+ // helper
+ private:
+
+ //---------------------------------------
+ /** @short implements the default handling:
+ - intercept or forward to internal handler.
+ */
+ UCBHELPER_DLLPRIVATE void impl_handleDefault(const ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionRequest >& xRequest);
+
+ //---------------------------------------
+ /** @short implements the interception of requests.
+
+ @descr The incoming request will be analyzed, if it match
+ any request of the m_lIntercepions list.
+ If an interception could be found, its continuation will be
+ searched and selected.
+
+ The method return the state of that operation.
+ But it doesnt call the intercepted and here set
+ interaction handler. That has to be done in the outside method.
+
+ @param xRequest
+ the interaction request, which should be intercepted.
+
+ @return A identifier, which inidicates if the request was intercepted,
+ the continuation was found and selected ... or not.
+ */
+ UCBHELPER_DLLPRIVATE EInterceptionState impl_interceptRequest(const ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionRequest >& xRequest);
+};
+
+} // namespace ucbhelper
+
+#endif // _UCBHELPER_INTERCEPTEDINTERACTION_HXX_
diff --git a/ucbhelper/inc/ucbhelper/macros.hxx b/ucbhelper/inc/ucbhelper/macros.hxx
new file mode 100644
index 000000000000..f32f1130c216
--- /dev/null
+++ b/ucbhelper/inc/ucbhelper/macros.hxx
@@ -0,0 +1,747 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef _UCBHELPER_MACROS_HXX
+#define _UCBHELPER_MACROS_HXX
+
+#include <sal/types.h>
+#include <cppuhelper/queryinterface.hxx>
+#include <cppuhelper/factory.hxx>
+#include <cppuhelper/weakref.hxx>
+#include <cppuhelper/typeprovider.hxx>
+
+#include "osl/mutex.hxx"
+
+//=========================================================================
+
+#define CPPU_TYPE( T ) getCppuType( static_cast< T * >( 0 ) )
+#define CPPU_TYPE_REF( T ) CPPU_TYPE( com::sun::star::uno::Reference< T > )
+
+//=========================================================================
+//
+// XInterface decl.
+//
+//=========================================================================
+
+#define XINTERFACE_DECL() \
+ virtual com::sun::star::uno::Any SAL_CALL \
+ queryInterface( const com::sun::star::uno::Type & rType ) \
+ throw( com::sun::star::uno::RuntimeException ); \
+ virtual void SAL_CALL \
+ acquire() \
+ throw(); \
+ virtual void SAL_CALL \
+ release() \
+ throw();
+
+//=========================================================================
+//
+// XInterface impl. internals.
+//
+//=========================================================================
+
+#define XINTERFACE_COMMON_IMPL( Class ) \
+void SAL_CALL Class::acquire() \
+ throw() \
+{ \
+ OWeakObject::acquire(); \
+} \
+ \
+void SAL_CALL Class::release() \
+ throw() \
+{ \
+ OWeakObject::release(); \
+}
+
+#define QUERYINTERFACE_IMPL_START( Class ) \
+com::sun::star::uno::Any SAL_CALL Class::queryInterface( \
+ const com::sun::star::uno::Type & rType ) \
+ throw( com::sun::star::uno::RuntimeException ) \
+{ \
+ com::sun::star::uno::Any aRet = cppu::queryInterface( rType,
+
+#define QUERYINTERFACE_IMPL_END \
+ ); \
+ return aRet.hasValue() ? aRet : OWeakObject::queryInterface( rType ); \
+}
+
+//=========================================================================
+//
+// XInterface impl.
+//
+//=========================================================================
+
+// 1 interface implemented
+#define XINTERFACE_IMPL_1( Class, Ifc1 ) \
+XINTERFACE_COMMON_IMPL( Class ) \
+QUERYINTERFACE_IMPL_START( Class ) \
+ SAL_STATIC_CAST( Ifc1*, this ) \
+QUERYINTERFACE_IMPL_END
+
+// 2 interfaces implemented
+#define XINTERFACE_IMPL_2( Class, Ifc1, Ifc2 ) \
+XINTERFACE_COMMON_IMPL( Class ) \
+QUERYINTERFACE_IMPL_START( Class ) \
+ SAL_STATIC_CAST( Ifc1*, this ), \
+ SAL_STATIC_CAST( Ifc2*, this ) \
+QUERYINTERFACE_IMPL_END
+
+// 3 interfaces implemented
+#define XINTERFACE_IMPL_3( Class, Ifc1, Ifc2, Ifc3 ) \
+XINTERFACE_COMMON_IMPL( Class ) \
+QUERYINTERFACE_IMPL_START( Class ) \
+ SAL_STATIC_CAST( Ifc1*, this ), \
+ SAL_STATIC_CAST( Ifc2*, this ), \
+ SAL_STATIC_CAST( Ifc3*, this ) \
+QUERYINTERFACE_IMPL_END
+
+// 4 interfaces implemented
+#define XINTERFACE_IMPL_4( Class, Ifc1, Ifc2, Ifc3, Ifc4 ) \
+XINTERFACE_COMMON_IMPL( Class ) \
+QUERYINTERFACE_IMPL_START( Class ) \
+ SAL_STATIC_CAST( Ifc1*, this ), \
+ SAL_STATIC_CAST( Ifc2*, this ), \
+ SAL_STATIC_CAST( Ifc3*, this ), \
+ SAL_STATIC_CAST( Ifc4*, this ) \
+QUERYINTERFACE_IMPL_END
+
+// 5 interfaces implemented
+#define XINTERFACE_IMPL_5( Class, Ifc1, Ifc2, Ifc3, Ifc4, Ifc5 ) \
+XINTERFACE_COMMON_IMPL( Class ) \
+QUERYINTERFACE_IMPL_START( Class ) \
+ SAL_STATIC_CAST( Ifc1*, this ), \
+ SAL_STATIC_CAST( Ifc2*, this ), \
+ SAL_STATIC_CAST( Ifc3*, this ), \
+ SAL_STATIC_CAST( Ifc4*, this ), \
+ SAL_STATIC_CAST( Ifc5*, this ) \
+QUERYINTERFACE_IMPL_END
+
+// 6 interfaces implemented
+#define XINTERFACE_IMPL_6( Class,I1,I2,I3,I4,I5,I6 ) \
+XINTERFACE_COMMON_IMPL( Class ) \
+QUERYINTERFACE_IMPL_START( Class ) \
+ SAL_STATIC_CAST( I1*, this ), \
+ SAL_STATIC_CAST( I2*, this ), \
+ SAL_STATIC_CAST( I3*, this ), \
+ SAL_STATIC_CAST( I4*, this ), \
+ SAL_STATIC_CAST( I5*, this ), \
+ SAL_STATIC_CAST( I6*, this ) \
+QUERYINTERFACE_IMPL_END
+
+// 7 interfaces implemented
+#define XINTERFACE_IMPL_7( Class,I1,I2,I3,I4,I5,I6,I7 ) \
+XINTERFACE_COMMON_IMPL( Class ) \
+QUERYINTERFACE_IMPL_START( Class ) \
+ SAL_STATIC_CAST( I1*, this ), \
+ SAL_STATIC_CAST( I2*, this ), \
+ SAL_STATIC_CAST( I3*, this ), \
+ SAL_STATIC_CAST( I4*, this ), \
+ SAL_STATIC_CAST( I5*, this ), \
+ SAL_STATIC_CAST( I6*, this ), \
+ SAL_STATIC_CAST( I7*, this ) \
+QUERYINTERFACE_IMPL_END
+
+// 8 interfaces implemented
+#define XINTERFACE_IMPL_8( Class,I1,I2,I3,I4,I5,I6,I7,I8 ) \
+XINTERFACE_COMMON_IMPL( Class ) \
+QUERYINTERFACE_IMPL_START( Class ) \
+ SAL_STATIC_CAST( I1*, this ), \
+ SAL_STATIC_CAST( I2*, this ), \
+ SAL_STATIC_CAST( I3*, this ), \
+ SAL_STATIC_CAST( I4*, this ), \
+ SAL_STATIC_CAST( I5*, this ), \
+ SAL_STATIC_CAST( I6*, this ), \
+ SAL_STATIC_CAST( I7*, this ), \
+ SAL_STATIC_CAST( I8*, this ) \
+QUERYINTERFACE_IMPL_END
+
+// 9 interfaces implemented
+#define XINTERFACE_IMPL_9( Class,I1,I2,I3,I4,I5,I6,I7,I8,I9 ) \
+XINTERFACE_COMMON_IMPL( Class ) \
+QUERYINTERFACE_IMPL_START( Class ) \
+ SAL_STATIC_CAST( I1*, this ), \
+ SAL_STATIC_CAST( I2*, this ), \
+ SAL_STATIC_CAST( I3*, this ), \
+ SAL_STATIC_CAST( I4*, this ), \
+ SAL_STATIC_CAST( I5*, this ), \
+ SAL_STATIC_CAST( I6*, this ), \
+ SAL_STATIC_CAST( I7*, this ), \
+ SAL_STATIC_CAST( I8*, this ), \
+ SAL_STATIC_CAST( I9*, this ) \
+QUERYINTERFACE_IMPL_END
+
+// 10 interfaces implemented
+#define XINTERFACE_IMPL_10( Class,I1,I2,I3,I4,I5,I6,I7,I8,I9,I10 ) \
+XINTERFACE_COMMON_IMPL( Class ) \
+QUERYINTERFACE_IMPL_START( Class ) \
+ SAL_STATIC_CAST( I1*, this ), \
+ SAL_STATIC_CAST( I2*, this ), \
+ SAL_STATIC_CAST( I3*, this ), \
+ SAL_STATIC_CAST( I4*, this ), \
+ SAL_STATIC_CAST( I5*, this ), \
+ SAL_STATIC_CAST( I6*, this ), \
+ SAL_STATIC_CAST( I7*, this ), \
+ SAL_STATIC_CAST( I8*, this ), \
+ SAL_STATIC_CAST( I9*, this ), \
+ SAL_STATIC_CAST( I10*, this ) \
+QUERYINTERFACE_IMPL_END
+
+// 11 interfaces implemented
+#define XINTERFACE_IMPL_11( Class,I1,I2,I3,I4,I5,I6,I7,I8,I9,I10,I11 ) \
+XINTERFACE_COMMON_IMPL( Class ) \
+QUERYINTERFACE_IMPL_START( Class ) \
+ SAL_STATIC_CAST( I1*, this ), \
+ SAL_STATIC_CAST( I2*, this ), \
+ SAL_STATIC_CAST( I3*, this ), \
+ SAL_STATIC_CAST( I4*, this ), \
+ SAL_STATIC_CAST( I5*, this ), \
+ SAL_STATIC_CAST( I6*, this ), \
+ SAL_STATIC_CAST( I7*, this ), \
+ SAL_STATIC_CAST( I8*, this ), \
+ SAL_STATIC_CAST( I9*, this ), \
+ SAL_STATIC_CAST( I10*, this ), \
+ SAL_STATIC_CAST( I11*, this ) \
+QUERYINTERFACE_IMPL_END
+
+// 12 interfaces implemented
+#define XINTERFACE_IMPL_12( Class,I1,I2,I3,I4,I5,I6,I7,I8,I9,I10,I11,I12 ) \
+XINTERFACE_COMMON_IMPL( Class ) \
+QUERYINTERFACE_IMPL_START( Class ) \
+ SAL_STATIC_CAST( I1*, this ), \
+ SAL_STATIC_CAST( I2*, this ), \
+ SAL_STATIC_CAST( I3*, this ), \
+ SAL_STATIC_CAST( I4*, this ), \
+ SAL_STATIC_CAST( I5*, this ), \
+ SAL_STATIC_CAST( I6*, this ), \
+ SAL_STATIC_CAST( I7*, this ), \
+ SAL_STATIC_CAST( I8*, this ), \
+ SAL_STATIC_CAST( I9*, this ), \
+ SAL_STATIC_CAST( I10*, this ), \
+ SAL_STATIC_CAST( I11*, this ), \
+ SAL_STATIC_CAST( I12*, this ) \
+QUERYINTERFACE_IMPL_END
+
+// 13 interfaces implemented
+#define XINTERFACE_IMPL_13( Class,I1,I2,I3,I4,I5,I6,I7,I8,I9,I10,I11,I12,I13 ) \
+XINTERFACE_COMMON_IMPL( Class ) \
+QUERYINTERFACE_IMPL_START( Class ) \
+ SAL_STATIC_CAST( I1*, this ), \
+ SAL_STATIC_CAST( I2*, this ), \
+ SAL_STATIC_CAST( I3*, this ), \
+ SAL_STATIC_CAST( I4*, this ), \
+ SAL_STATIC_CAST( I5*, this ), \
+ SAL_STATIC_CAST( I6*, this ), \
+ SAL_STATIC_CAST( I7*, this ), \
+ SAL_STATIC_CAST( I8*, this ), \
+ SAL_STATIC_CAST( I9*, this ), \
+ SAL_STATIC_CAST( I10*, this ), \
+ SAL_STATIC_CAST( I11*, this ), \
+ SAL_STATIC_CAST( I12*, this ), \
+ SAL_STATIC_CAST( I13*, this ) \
+QUERYINTERFACE_IMPL_END
+
+// 14 interfaces implemented
+#define XINTERFACE_IMPL_14( Class,I1,I2,I3,I4,I5,I6,I7,I8,I9,I10,I11,I12,I13,I14 ) \
+XINTERFACE_COMMON_IMPL( Class ) \
+QUERYINTERFACE_IMPL_START( Class ) \
+ SAL_STATIC_CAST( I1*, this ), \
+ SAL_STATIC_CAST( I2*, this ), \
+ SAL_STATIC_CAST( I3*, this ), \
+ SAL_STATIC_CAST( I4*, this ), \
+ SAL_STATIC_CAST( I5*, this ), \
+ SAL_STATIC_CAST( I6*, this ), \
+ SAL_STATIC_CAST( I7*, this ), \
+ SAL_STATIC_CAST( I8*, this ), \
+ SAL_STATIC_CAST( I9*, this ), \
+ SAL_STATIC_CAST( I10*, this ), \
+ SAL_STATIC_CAST( I11*, this ), \
+ SAL_STATIC_CAST( I12*, this ), \
+ SAL_STATIC_CAST( I13*, this ), \
+ SAL_STATIC_CAST( I14*, this ) \
+QUERYINTERFACE_IMPL_END
+
+// 15 interfaces implemented
+#define XINTERFACE_IMPL_15( Class,I1,I2,I3,I4,I5,I6,I7,I8,I9,I10,I11,I12,I13,I14,I15 ) \
+XINTERFACE_COMMON_IMPL( Class ) \
+QUERYINTERFACE_IMPL_START( Class ) \
+ SAL_STATIC_CAST( I1*, this ), \
+ SAL_STATIC_CAST( I2*, this ), \
+ SAL_STATIC_CAST( I3*, this ), \
+ SAL_STATIC_CAST( I4*, this ), \
+ SAL_STATIC_CAST( I5*, this ), \
+ SAL_STATIC_CAST( I6*, this ), \
+ SAL_STATIC_CAST( I7*, this ), \
+ SAL_STATIC_CAST( I8*, this ), \
+ SAL_STATIC_CAST( I9*, this ), \
+ SAL_STATIC_CAST( I10*, this ), \
+ SAL_STATIC_CAST( I11*, this ), \
+ SAL_STATIC_CAST( I12*, this ), \
+ SAL_STATIC_CAST( I13*, this ), \
+ SAL_STATIC_CAST( I14*, this ), \
+ SAL_STATIC_CAST( I15*, this ) \
+QUERYINTERFACE_IMPL_END
+
+//=========================================================================
+//
+// XTypeProvider decl.
+//
+//=========================================================================
+
+#define XTYPEPROVIDER_DECL() \
+ virtual com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL \
+ getImplementationId() \
+ throw( com::sun::star::uno::RuntimeException ); \
+ virtual com::sun::star::uno::Sequence< com::sun::star::uno::Type > SAL_CALL \
+ getTypes() \
+ throw( com::sun::star::uno::RuntimeException );
+
+//=========================================================================
+//
+// XTypeProvider impl. internals
+//
+//=========================================================================
+
+#define XTYPEPROVIDER_COMMON_IMPL( Class ) \
+com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL \
+Class::getImplementationId() \
+ throw( com::sun::star::uno::RuntimeException ) \
+{ \
+ static cppu::OImplementationId* pId = NULL; \
+ if ( !pId ) \
+ { \
+ osl::Guard< osl::Mutex > aGuard( osl::Mutex::getGlobalMutex() ); \
+ if ( !pId ) \
+ { \
+ static cppu::OImplementationId id( sal_False ); \
+ pId = &id; \
+ } \
+ } \
+ return (*pId).getImplementationId(); \
+}
+
+#define GETTYPES_IMPL_START( Class ) \
+com::sun::star::uno::Sequence< com::sun::star::uno::Type > SAL_CALL \
+Class::getTypes() \
+ throw( com::sun::star::uno::RuntimeException ) \
+{ \
+ static cppu::OTypeCollection* pCollection = NULL; \
+ if ( !pCollection ) \
+ { \
+ osl::Guard< osl::Mutex > aGuard( osl::Mutex::getGlobalMutex() ); \
+ if ( !pCollection ) \
+ { \
+ static cppu::OTypeCollection collection(
+
+#define GETTYPES_IMPL_END \
+ ); \
+ pCollection = &collection; \
+ } \
+ } \
+ return (*pCollection).getTypes(); \
+}
+
+//=========================================================================
+//
+// XTypeProvider impl.
+//
+//=========================================================================
+
+// 1 interface supported
+#define XTYPEPROVIDER_IMPL_1( Class, I1 ) \
+XTYPEPROVIDER_COMMON_IMPL( Class ) \
+GETTYPES_IMPL_START( Class ) \
+ CPPU_TYPE_REF( I1 ) \
+GETTYPES_IMPL_END
+
+// 2 interfaces supported
+#define XTYPEPROVIDER_IMPL_2( Class, I1,I2 ) \
+XTYPEPROVIDER_COMMON_IMPL( Class ) \
+GETTYPES_IMPL_START( Class ) \
+ CPPU_TYPE_REF( I1 ), \
+ CPPU_TYPE_REF( I2 ) \
+GETTYPES_IMPL_END
+
+// 3 interfaces supported
+#define XTYPEPROVIDER_IMPL_3( Class, I1,I2,I3 ) \
+XTYPEPROVIDER_COMMON_IMPL( Class ) \
+GETTYPES_IMPL_START( Class ) \
+ CPPU_TYPE_REF( I1 ), \
+ CPPU_TYPE_REF( I2 ), \
+ CPPU_TYPE_REF( I3 ) \
+GETTYPES_IMPL_END
+
+// 4 interfaces supported
+#define XTYPEPROVIDER_IMPL_4( Class, I1,I2,I3,I4 ) \
+XTYPEPROVIDER_COMMON_IMPL( Class ) \
+GETTYPES_IMPL_START( Class ) \
+ CPPU_TYPE_REF( I1 ), \
+ CPPU_TYPE_REF( I2 ), \
+ CPPU_TYPE_REF( I3 ), \
+ CPPU_TYPE_REF( I4 ) \
+GETTYPES_IMPL_END
+
+// 5 interfaces supported
+#define XTYPEPROVIDER_IMPL_5( Class, I1,I2,I3,I4,I5 ) \
+XTYPEPROVIDER_COMMON_IMPL( Class ) \
+GETTYPES_IMPL_START( Class ) \
+ CPPU_TYPE_REF( I1 ), \
+ CPPU_TYPE_REF( I2 ), \
+ CPPU_TYPE_REF( I3 ), \
+ CPPU_TYPE_REF( I4 ), \
+ CPPU_TYPE_REF( I5 ) \
+GETTYPES_IMPL_END
+
+// 6 interfaces supported
+#define XTYPEPROVIDER_IMPL_6( Class, I1,I2,I3,I4,I5,I6 ) \
+XTYPEPROVIDER_COMMON_IMPL( Class ) \
+GETTYPES_IMPL_START( Class ) \
+ CPPU_TYPE_REF( I1 ), \
+ CPPU_TYPE_REF( I2 ), \
+ CPPU_TYPE_REF( I3 ), \
+ CPPU_TYPE_REF( I4 ), \
+ CPPU_TYPE_REF( I5 ), \
+ CPPU_TYPE_REF( I6 ) \
+GETTYPES_IMPL_END
+
+// 7 interfaces supported
+#define XTYPEPROVIDER_IMPL_7( Class, I1,I2,I3,I4,I5,I6,I7 ) \
+XTYPEPROVIDER_COMMON_IMPL( Class ) \
+GETTYPES_IMPL_START( Class ) \
+ CPPU_TYPE_REF( I1 ), \
+ CPPU_TYPE_REF( I2 ), \
+ CPPU_TYPE_REF( I3 ), \
+ CPPU_TYPE_REF( I4 ), \
+ CPPU_TYPE_REF( I5 ), \
+ CPPU_TYPE_REF( I6 ), \
+ CPPU_TYPE_REF( I7 ) \
+GETTYPES_IMPL_END
+
+// 8 interfaces supported
+#define XTYPEPROVIDER_IMPL_8( Class, I1,I2,I3,I4,I5,I6,I7,I8 ) \
+XTYPEPROVIDER_COMMON_IMPL( Class ) \
+GETTYPES_IMPL_START( Class ) \
+ CPPU_TYPE_REF( I1 ), \
+ CPPU_TYPE_REF( I2 ), \
+ CPPU_TYPE_REF( I3 ), \
+ CPPU_TYPE_REF( I4 ), \
+ CPPU_TYPE_REF( I5 ), \
+ CPPU_TYPE_REF( I6 ), \
+ CPPU_TYPE_REF( I7 ), \
+ CPPU_TYPE_REF( I8 ) \
+GETTYPES_IMPL_END
+
+// 9 interfaces supported
+#define XTYPEPROVIDER_IMPL_9( Class, I1,I2,I3,I4,I5,I6,I7,I8,I9 ) \
+XTYPEPROVIDER_COMMON_IMPL( Class ) \
+GETTYPES_IMPL_START( Class ) \
+ CPPU_TYPE_REF( I1 ), \
+ CPPU_TYPE_REF( I2 ), \
+ CPPU_TYPE_REF( I3 ), \
+ CPPU_TYPE_REF( I4 ), \
+ CPPU_TYPE_REF( I5 ), \
+ CPPU_TYPE_REF( I6 ), \
+ CPPU_TYPE_REF( I7 ), \
+ CPPU_TYPE_REF( I8 ), \
+ CPPU_TYPE_REF( I9 ) \
+GETTYPES_IMPL_END
+
+// 10 interfaces supported
+#define XTYPEPROVIDER_IMPL_10( Class, I1,I2,I3,I4,I5,I6,I7,I8,I9,I10 ) \
+XTYPEPROVIDER_COMMON_IMPL( Class ) \
+GETTYPES_IMPL_START( Class ) \
+ CPPU_TYPE_REF( I1 ), \
+ CPPU_TYPE_REF( I2 ), \
+ CPPU_TYPE_REF( I3 ), \
+ CPPU_TYPE_REF( I4 ), \
+ CPPU_TYPE_REF( I5 ), \
+ CPPU_TYPE_REF( I6 ), \
+ CPPU_TYPE_REF( I7 ), \
+ CPPU_TYPE_REF( I8 ), \
+ CPPU_TYPE_REF( I9 ), \
+ CPPU_TYPE_REF( I10 ) \
+GETTYPES_IMPL_END
+
+// 11 interfaces supported
+#define XTYPEPROVIDER_IMPL_11( Class, I1,I2,I3,I4,I5,I6,I7,I8,I9,I10,I11 ) \
+XTYPEPROVIDER_COMMON_IMPL( Class ) \
+GETTYPES_IMPL_START( Class ) \
+ CPPU_TYPE_REF( I1 ), \
+ CPPU_TYPE_REF( I2 ), \
+ CPPU_TYPE_REF( I3 ), \
+ CPPU_TYPE_REF( I4 ), \
+ CPPU_TYPE_REF( I5 ), \
+ CPPU_TYPE_REF( I6 ), \
+ CPPU_TYPE_REF( I7 ), \
+ CPPU_TYPE_REF( I8 ), \
+ CPPU_TYPE_REF( I9 ), \
+ CPPU_TYPE_REF( I10 ), \
+ CPPU_TYPE_REF( I11 ) \
+GETTYPES_IMPL_END
+
+// 12 interfaces supported
+#define XTYPEPROVIDER_IMPL_12( Class, I1,I2,I3,I4,I5,I6,I7,I8,I9,I10,I11,I12 ) \
+XTYPEPROVIDER_COMMON_IMPL( Class ) \
+GETTYPES_IMPL_START( Class ) \
+ CPPU_TYPE_REF( I1 ), \
+ CPPU_TYPE_REF( I2 ), \
+ CPPU_TYPE_REF( I3 ), \
+ CPPU_TYPE_REF( I4 ), \
+ CPPU_TYPE_REF( I5 ), \
+ CPPU_TYPE_REF( I6 ), \
+ CPPU_TYPE_REF( I7 ), \
+ CPPU_TYPE_REF( I8 ), \
+ CPPU_TYPE_REF( I9 ), \
+ CPPU_TYPE_REF( I10 ), \
+ CPPU_TYPE_REF( I11 ), \
+ CPPU_TYPE_REF( I12 ) \
+GETTYPES_IMPL_END
+
+// 13 interfaces supported
+#define XTYPEPROVIDER_IMPL_13( Class, I1,I2,I3,I4,I5,I6,I7,I8,I9,I10,I11,I12,I13 ) \
+XTYPEPROVIDER_COMMON_IMPL( Class ) \
+GETTYPES_IMPL_START( Class ) \
+ CPPU_TYPE_REF( I1 ), \
+ CPPU_TYPE_REF( I2 ), \
+ CPPU_TYPE_REF( I3 ), \
+ CPPU_TYPE_REF( I4 ), \
+ CPPU_TYPE_REF( I5 ), \
+ CPPU_TYPE_REF( I6 ), \
+ CPPU_TYPE_REF( I7 ), \
+ CPPU_TYPE_REF( I8 ), \
+ CPPU_TYPE_REF( I9 ), \
+ CPPU_TYPE_REF( I10 ), \
+ CPPU_TYPE_REF( I11 ), \
+ CPPU_TYPE_REF( I12 ), \
+ CPPU_TYPE_REF( I13 ) \
+GETTYPES_IMPL_END
+
+// 14 interfaces supported
+#define XTYPEPROVIDER_IMPL_14( Class, I1,I2,I3,I4,I5,I6,I7,I8,I9,I10,I11,I12,I13,I14 ) \
+XTYPEPROVIDER_COMMON_IMPL( Class ) \
+GETTYPES_IMPL_START( Class ) \
+ CPPU_TYPE_REF( I1 ), \
+ CPPU_TYPE_REF( I2 ), \
+ CPPU_TYPE_REF( I3 ), \
+ CPPU_TYPE_REF( I4 ), \
+ CPPU_TYPE_REF( I5 ), \
+ CPPU_TYPE_REF( I6 ), \
+ CPPU_TYPE_REF( I7 ), \
+ CPPU_TYPE_REF( I8 ), \
+ CPPU_TYPE_REF( I9 ), \
+ CPPU_TYPE_REF( I10 ), \
+ CPPU_TYPE_REF( I11 ), \
+ CPPU_TYPE_REF( I12 ), \
+ CPPU_TYPE_REF( I13 ), \
+ CPPU_TYPE_REF( I14 ) \
+GETTYPES_IMPL_END
+
+// 15 interfaces supported
+#define XTYPEPROVIDER_IMPL_15( Class, I1,I2,I3,I4,I5,I6,I7,I8,I9,I10,I11,I12,I13,I14,I15 ) \
+XTYPEPROVIDER_COMMON_IMPL( Class ) \
+GETTYPES_IMPL_START( Class ) \
+ CPPU_TYPE_REF( I1 ), \
+ CPPU_TYPE_REF( I2 ), \
+ CPPU_TYPE_REF( I3 ), \
+ CPPU_TYPE_REF( I4 ), \
+ CPPU_TYPE_REF( I5 ), \
+ CPPU_TYPE_REF( I6 ), \
+ CPPU_TYPE_REF( I7 ), \
+ CPPU_TYPE_REF( I8 ), \
+ CPPU_TYPE_REF( I9 ), \
+ CPPU_TYPE_REF( I10 ), \
+ CPPU_TYPE_REF( I11 ), \
+ CPPU_TYPE_REF( I12 ), \
+ CPPU_TYPE_REF( I13 ), \
+ CPPU_TYPE_REF( I14 ), \
+ CPPU_TYPE_REF( I15 ) \
+GETTYPES_IMPL_END
+
+//=========================================================================
+//
+// XServiceInfo decl.
+//
+//=========================================================================
+
+#define XSERVICEINFO_NOFACTORY_DECL() \
+ virtual rtl::OUString SAL_CALL \
+ getImplementationName() \
+ throw( com::sun::star::uno::RuntimeException ); \
+ virtual sal_Bool SAL_CALL \
+ supportsService( const rtl::OUString& ServiceName ) \
+ throw( com::sun::star::uno::RuntimeException ); \
+ virtual com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL \
+ getSupportedServiceNames() \
+ throw( com::sun::star::uno::RuntimeException ); \
+ \
+ static rtl::OUString \
+ getImplementationName_Static(); \
+ static com::sun::star::uno::Sequence< rtl::OUString > \
+ getSupportedServiceNames_Static();
+
+#define XSERVICEINFO_DECL() \
+ XSERVICEINFO_NOFACTORY_DECL() \
+ \
+ static com::sun::star::uno::Reference< \
+ com::sun::star::lang::XSingleServiceFactory > \
+ createServiceFactory( const com::sun::star::uno::Reference< \
+ com::sun::star::lang::XMultiServiceFactory >& rxServiceMgr );
+
+//=========================================================================
+//
+// XServiceInfo impl. internals
+//
+//=========================================================================
+
+#define XSERVICEINFO_COMMOM_IMPL( Class, ImplName ) \
+rtl::OUString SAL_CALL Class::getImplementationName() \
+ throw( com::sun::star::uno::RuntimeException ) \
+{ \
+ return getImplementationName_Static(); \
+} \
+ \
+rtl::OUString Class::getImplementationName_Static() \
+{ \
+ return ImplName; \
+} \
+ \
+sal_Bool SAL_CALL \
+Class::supportsService( const rtl::OUString& ServiceName ) \
+ throw( com::sun::star::uno::RuntimeException ) \
+{ \
+ com::sun::star::uno::Sequence< rtl::OUString > aSNL = \
+ getSupportedServiceNames(); \
+ const rtl::OUString* pArray = aSNL.getArray(); \
+ for( sal_Int32 i = 0; i < aSNL.getLength(); i++ ) \
+ { \
+ if( pArray[ i ] == ServiceName ) \
+ return sal_True; \
+ } \
+ \
+ return sal_False; \
+} \
+ \
+com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL \
+Class::getSupportedServiceNames() \
+ throw( com::sun::star::uno::RuntimeException ) \
+{ \
+ return getSupportedServiceNames_Static(); \
+}
+
+#define XSERVICEINFO_CREATE_INSTANCE_IMPL( Class ) \
+static com::sun::star::uno::Reference< \
+ com::sun::star::uno::XInterface > SAL_CALL \
+Class##_CreateInstance( const com::sun::star::uno::Reference< \
+ com::sun::star::lang::XMultiServiceFactory> & rSMgr ) \
+ throw( com::sun::star::uno::Exception ) \
+{ \
+ com::sun::star::lang::XServiceInfo* pX = \
+ (com::sun::star::lang::XServiceInfo*)new Class( rSMgr ); \
+ return com::sun::star::uno::Reference< \
+ com::sun::star::uno::XInterface >::query( pX ); \
+}
+
+//=========================================================================
+//
+// XServiceInfo impl.
+//
+//=========================================================================
+
+#define ONE_INSTANCE_SERVICE_FACTORY_IMPL( Class ) \
+com::sun::star::uno::Reference< \
+ com::sun::star::lang::XSingleServiceFactory > \
+Class::createServiceFactory( const com::sun::star::uno::Reference< \
+ com::sun::star::lang::XMultiServiceFactory >& rxServiceMgr ) \
+{ \
+ return com::sun::star::uno::Reference< \
+ com::sun::star::lang::XSingleServiceFactory >( \
+ cppu::createOneInstanceFactory( \
+ rxServiceMgr, \
+ Class::getImplementationName_Static(), \
+ Class##_CreateInstance, \
+ Class::getSupportedServiceNames_Static() ) ); \
+}
+
+#define SINGLE_SERVICE_FACTORY_IMPL( Class ) \
+com::sun::star::uno::Reference< \
+ com::sun::star::lang::XSingleServiceFactory > \
+Class::createServiceFactory( const com::sun::star::uno::Reference< \
+ com::sun::star::lang::XMultiServiceFactory >& rxServiceMgr ) \
+{ \
+ return com::sun::star::uno::Reference< \
+ com::sun::star::lang::XSingleServiceFactory >( \
+ cppu::createSingleFactory( \
+ rxServiceMgr, \
+ Class::getImplementationName_Static(), \
+ Class##_CreateInstance, \
+ Class::getSupportedServiceNames_Static() ) ); \
+}
+
+// Service without service factory.
+
+// Own implementation of getSupportedServiceNames_Static().
+#define XSERVICEINFO_NOFACTORY_IMPL_0( Class, ImplName ) \
+XSERVICEINFO_COMMOM_IMPL( Class, ImplName ) \
+ \
+com::sun::star::uno::Sequence< rtl::OUString > \
+Class::getSupportedServiceNames_Static()
+
+// 1 service name
+#define XSERVICEINFO_NOFACTORY_IMPL_1( Class, ImplName, Service1 ) \
+XSERVICEINFO_COMMOM_IMPL( Class, ImplName ) \
+ \
+com::sun::star::uno::Sequence< rtl::OUString > \
+Class::getSupportedServiceNames_Static() \
+{ \
+ com::sun::star::uno::Sequence< rtl::OUString > aSNS( 1 ); \
+ aSNS.getArray()[ 0 ] = Service1; \
+ return aSNS; \
+}
+
+// Service with service factory.
+
+// Own implementation of getSupportedServiceNames_Static().
+#define XSERVICEINFO_IMPL_0( Class, ImplName ) \
+XSERVICEINFO_COMMOM_IMPL( Class, ImplName ) \
+XSERVICEINFO_CREATE_INSTANCE_IMPL( Class ) \
+ \
+com::sun::star::uno::Sequence< rtl::OUString > \
+Class::getSupportedServiceNames_Static()
+
+// 1 service name
+#define XSERVICEINFO_IMPL_1( Class, ImplName, Service1 ) \
+XSERVICEINFO_COMMOM_IMPL( Class, ImplName ) \
+XSERVICEINFO_CREATE_INSTANCE_IMPL( Class ) \
+ \
+com::sun::star::uno::Sequence< rtl::OUString > \
+Class::getSupportedServiceNames_Static() \
+{ \
+ com::sun::star::uno::Sequence< rtl::OUString > aSNS( 1 ); \
+ aSNS.getArray()[ 0 ] = Service1; \
+ return aSNS; \
+}
+
+#endif /* !_UCBHELPER_MACROS_HXX */
diff --git a/ucbhelper/inc/ucbhelper/propertyvalueset.hxx b/ucbhelper/inc/ucbhelper/propertyvalueset.hxx
new file mode 100644
index 000000000000..82d440df0c02
--- /dev/null
+++ b/ucbhelper/inc/ucbhelper/propertyvalueset.hxx
@@ -0,0 +1,434 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef _UCBHELPER_PROPERTYVALUESET_HXX
+#define _UCBHELPER_PROPERTYVALUESET_HXX
+
+#include <com/sun/star/lang/XMultiServiceFactory.hpp>
+#include <com/sun/star/lang/XTypeProvider.hpp>
+#include <com/sun/star/sdbc/XColumnLocate.hpp>
+#include <com/sun/star/sdbc/XRow.hpp>
+#include <com/sun/star/beans/Property.hpp>
+#include <cppuhelper/weak.hxx>
+
+#include "osl/mutex.hxx"
+#include <ucbhelper/macros.hxx>
+#include "ucbhelper/ucbhelperdllapi.h"
+
+namespace com { namespace sun { namespace star { namespace script {
+ class XTypeConverter;
+} } } }
+
+namespace com { namespace sun { namespace star { namespace beans {
+ struct PropertyValue;
+ class XPropertySet;
+} } } }
+
+namespace ucbhelper {
+
+class PropertyValues;
+
+//=========================================================================
+
+/**
+ * This class implements the interface XRow. After construction of a valueset
+ * the user can append properties ( incl. its values ) to the set. This class
+ * is useful when implementing the command "getPropertyValues", because the
+ * values to return can easyly appended to a valueset object. That object can
+ * directly be returned by the implementation of the command.
+ */
+class UCBHELPER_DLLPUBLIC PropertyValueSet :
+ public cppu::OWeakObject,
+ public com::sun::star::lang::XTypeProvider,
+ public com::sun::star::sdbc::XRow,
+ public com::sun::star::sdbc::XColumnLocate
+{
+ com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory >
+ m_xSMgr;
+ com::sun::star::uno::Reference< com::sun::star::script::XTypeConverter >
+ m_xTypeConverter;
+ osl::Mutex m_aMutex;
+ PropertyValues* m_pValues;
+ sal_Bool m_bWasNull;
+ sal_Bool m_bTriedToGetTypeConverter;
+
+private:
+ UCBHELPER_DLLPRIVATE const com::sun::star::uno::Reference<
+ com::sun::star::script::XTypeConverter >&
+ getTypeConverter();
+
+public:
+ PropertyValueSet(
+ const com::sun::star::uno::Reference<
+ com::sun::star::lang::XMultiServiceFactory >& rxSMgr );
+ PropertyValueSet(
+ const com::sun::star::uno::Reference<
+ com::sun::star::lang::XMultiServiceFactory >& rxSMgr,
+ const com::sun::star::uno::Sequence<
+ com::sun::star::beans::PropertyValue >& rValues );
+ virtual ~PropertyValueSet();
+
+ // XInterface
+ XINTERFACE_DECL()
+
+ // XTypeProvider
+ XTYPEPROVIDER_DECL()
+
+ // XRow
+ virtual sal_Bool SAL_CALL
+ wasNull()
+ throw( ::com::sun::star::sdbc::SQLException,
+ ::com::sun::star::uno::RuntimeException );
+ virtual ::rtl::OUString SAL_CALL
+ getString( sal_Int32 columnIndex )
+ throw( ::com::sun::star::sdbc::SQLException,
+ ::com::sun::star::uno::RuntimeException );
+ virtual sal_Bool SAL_CALL
+ getBoolean( sal_Int32 columnIndex )
+ throw( ::com::sun::star::sdbc::SQLException,
+ ::com::sun::star::uno::RuntimeException );
+ virtual sal_Int8 SAL_CALL
+ getByte( sal_Int32 columnIndex )
+ throw( ::com::sun::star::sdbc::SQLException,
+ ::com::sun::star::uno::RuntimeException );
+ virtual sal_Int16 SAL_CALL
+ getShort( sal_Int32 columnIndex )
+ throw( ::com::sun::star::sdbc::SQLException,
+ ::com::sun::star::uno::RuntimeException );
+ virtual sal_Int32 SAL_CALL
+ getInt( sal_Int32 columnIndex )
+ throw( ::com::sun::star::sdbc::SQLException,
+ ::com::sun::star::uno::RuntimeException );
+ virtual sal_Int64 SAL_CALL
+ getLong( sal_Int32 columnIndex )
+ throw( ::com::sun::star::sdbc::SQLException,
+ ::com::sun::star::uno::RuntimeException );
+ virtual float SAL_CALL
+ getFloat( sal_Int32 columnIndex )
+ throw( ::com::sun::star::sdbc::SQLException,
+ ::com::sun::star::uno::RuntimeException );
+ virtual double SAL_CALL
+ getDouble( sal_Int32 columnIndex )
+ throw( ::com::sun::star::sdbc::SQLException,
+ ::com::sun::star::uno::RuntimeException );
+ virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL
+ getBytes( sal_Int32 columnIndex )
+ throw( ::com::sun::star::sdbc::SQLException,
+ ::com::sun::star::uno::RuntimeException );
+ virtual ::com::sun::star::util::Date SAL_CALL
+ getDate( sal_Int32 columnIndex )
+ throw( ::com::sun::star::sdbc::SQLException,
+ ::com::sun::star::uno::RuntimeException );
+ virtual ::com::sun::star::util::Time SAL_CALL
+ getTime( sal_Int32 columnIndex )
+ throw( ::com::sun::star::sdbc::SQLException,
+ ::com::sun::star::uno::RuntimeException );
+ virtual ::com::sun::star::util::DateTime SAL_CALL
+ getTimestamp( sal_Int32 columnIndex )
+ throw( ::com::sun::star::sdbc::SQLException,
+ ::com::sun::star::uno::RuntimeException );
+ virtual ::com::sun::star::uno::Reference<
+ ::com::sun::star::io::XInputStream > SAL_CALL
+ getBinaryStream( sal_Int32 columnIndex )
+ throw( ::com::sun::star::sdbc::SQLException,
+ ::com::sun::star::uno::RuntimeException );
+ virtual ::com::sun::star::uno::Reference<
+ ::com::sun::star::io::XInputStream > SAL_CALL
+ getCharacterStream( sal_Int32 columnIndex )
+ throw( ::com::sun::star::sdbc::SQLException,
+ ::com::sun::star::uno::RuntimeException );
+ virtual ::com::sun::star::uno::Any SAL_CALL
+ getObject( sal_Int32 columnIndex,
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::container::XNameAccess >& typeMap )
+ throw( ::com::sun::star::sdbc::SQLException,
+ ::com::sun::star::uno::RuntimeException );
+ virtual ::com::sun::star::uno::Reference<
+ ::com::sun::star::sdbc::XRef > SAL_CALL
+ getRef( sal_Int32 columnIndex )
+ throw( ::com::sun::star::sdbc::SQLException,
+ ::com::sun::star::uno::RuntimeException );
+ virtual ::com::sun::star::uno::Reference<
+ ::com::sun::star::sdbc::XBlob > SAL_CALL
+ getBlob( sal_Int32 columnIndex )
+ throw( ::com::sun::star::sdbc::SQLException,
+ ::com::sun::star::uno::RuntimeException );
+ virtual ::com::sun::star::uno::Reference<
+ ::com::sun::star::sdbc::XClob > SAL_CALL
+ getClob( sal_Int32 columnIndex )
+ throw( ::com::sun::star::sdbc::SQLException,
+ ::com::sun::star::uno::RuntimeException );
+ virtual ::com::sun::star::uno::Reference<
+ ::com::sun::star::sdbc::XArray > SAL_CALL
+ getArray( sal_Int32 columnIndex )
+ throw( ::com::sun::star::sdbc::SQLException,
+ ::com::sun::star::uno::RuntimeException );
+
+ // XColumnLocate
+ virtual sal_Int32 SAL_CALL
+ findColumn( const ::rtl::OUString& columnName )
+ throw( ::com::sun::star::sdbc::SQLException,
+ ::com::sun::star::uno::RuntimeException );
+
+ //////////////////////////////////////////////////////////////////////
+ // Non-interface methods
+ //////////////////////////////////////////////////////////////////////
+
+ /**
+ * This method returns the number of elements of the value set.
+ *
+ * @return the number of elements of the value set.
+ */
+ sal_Int32 getLength() const;
+
+ void appendString( const ::rtl::OUString& rPropName, const ::rtl::OUString& rValue );
+ void appendString( const sal_Char* pAsciiPropName, const ::rtl::OUString& rValue )
+ {
+ appendString( ::rtl::OUString::createFromAscii( pAsciiPropName ), rValue );
+ }
+ void appendString( const ::com::sun::star::beans::Property& rProp, const ::rtl::OUString& rValue )
+ {
+ appendString( rProp.Name, rValue );
+ }
+
+ void appendBoolean( const ::rtl::OUString& rPropName, sal_Bool bValue );
+ void appendBoolean( const sal_Char* pAsciiPropName, sal_Bool bValue )
+ {
+ appendBoolean( ::rtl::OUString::createFromAscii( pAsciiPropName ), bValue );
+ }
+ void appendBoolean( const ::com::sun::star::beans::Property& rProp, sal_Bool bValue )
+ {
+ appendBoolean( rProp.Name, bValue );
+ }
+
+ void appendByte( const ::rtl::OUString& rPropName, sal_Int8 nValue );
+ void appendByte( const sal_Char* pAsciiPropName, sal_Int8 nValue )
+ {
+ appendByte( ::rtl::OUString::createFromAscii( pAsciiPropName ), nValue );
+ }
+ void appendByte( const ::com::sun::star::beans::Property& rProp, sal_Int8 nValue )
+ {
+ appendByte( rProp.Name, nValue );
+ }
+
+ void appendShort( const ::rtl::OUString& rPropName, sal_Int16 nValue );
+ void appendShort( const sal_Char* pAsciiPropName, sal_Int16 nValue )
+ {
+ appendShort( ::rtl::OUString::createFromAscii( pAsciiPropName ), nValue );
+ }
+ void appendShort( const ::com::sun::star::beans::Property& rProp, sal_Int16 nValue )
+ {
+ appendShort( rProp.Name, nValue );
+ }
+
+ void appendInt( const ::rtl::OUString& rPropName, sal_Int32 nValue );
+ void appendInt( const sal_Char* pAsciiPropName, sal_Int32 nValue )
+ {
+ appendInt( ::rtl::OUString::createFromAscii( pAsciiPropName ), nValue );
+ }
+ void appendInt( const ::com::sun::star::beans::Property& rProp, sal_Int32 nValue )
+ {
+ appendInt( rProp.Name, nValue );
+ }
+
+ void appendLong( const ::rtl::OUString& rPropName, sal_Int64 nValue );
+ void appendLong( const sal_Char* pAsciiPropName, sal_Int64 nValue )
+ {
+ appendLong( ::rtl::OUString::createFromAscii( pAsciiPropName ), nValue );
+ }
+ void appendLong( const ::com::sun::star::beans::Property& rProp, sal_Int64 nValue )
+ {
+ appendLong( rProp.Name, nValue );
+ }
+
+ void appendFloat( const ::rtl::OUString& rPropName, float nValue );
+ void appendFloat( const sal_Char* pAsciiPropName, float nValue )
+ {
+ appendFloat( ::rtl::OUString::createFromAscii( pAsciiPropName ), nValue );
+ }
+ void appendFloat( const ::com::sun::star::beans::Property& rProp, float nValue )
+ {
+ appendFloat( rProp.Name, nValue );
+ }
+
+ void appendDouble( const ::rtl::OUString& rPropName, double nValue );
+ void appendDouble( const sal_Char* pAsciiPropName, double nValue )
+ {
+ appendDouble( ::rtl::OUString::createFromAscii( pAsciiPropName ), nValue );
+ }
+ void appendDouble( const ::com::sun::star::beans::Property& rProp, double nValue )
+ {
+ appendDouble( rProp.Name, nValue );
+ }
+
+ void appendBytes( const ::rtl::OUString& rPropName, const ::com::sun::star::uno::Sequence< sal_Int8 >& rValue );
+ void appendBytes( const sal_Char* pAsciiPropName, const ::com::sun::star::uno::Sequence< sal_Int8 >& rValue )
+ {
+ appendBytes( ::rtl::OUString::createFromAscii( pAsciiPropName ), rValue );
+ }
+ void appendBytes( const ::com::sun::star::beans::Property& rProp, const ::com::sun::star::uno::Sequence< sal_Int8 >& rValue )
+ {
+ appendBytes( rProp.Name, rValue );
+ }
+
+ void appendDate( const ::rtl::OUString& rPropName, const ::com::sun::star::util::Date& rValue );
+ void appendDate( const sal_Char* pAsciiPropName, const ::com::sun::star::util::Date& rValue )
+ {
+ appendDate( ::rtl::OUString::createFromAscii( pAsciiPropName ), rValue );
+ }
+ void appendDate( const ::com::sun::star::beans::Property& rProp, const ::com::sun::star::util::Date& rValue )
+ {
+ appendDate( rProp.Name, rValue );
+ }
+
+ void appendTime( const ::rtl::OUString& rPropName, const ::com::sun::star::util::Time& rValue );
+ void appendTime( const sal_Char* pAsciiPropName, const ::com::sun::star::util::Time& rValue )
+ {
+ appendTime( ::rtl::OUString::createFromAscii( pAsciiPropName ), rValue );
+ }
+ void appendTime( const ::com::sun::star::beans::Property& rProp, const ::com::sun::star::util::Time& rValue )
+ {
+ appendTime( rProp.Name, rValue );
+ }
+
+ void appendTimestamp( const ::rtl::OUString& rPropName, const ::com::sun::star::util::DateTime& rValue );
+ void appendTimestamp( const sal_Char* pAsciiPropName, const ::com::sun::star::util::DateTime& rValue )
+ {
+ appendTimestamp( ::rtl::OUString::createFromAscii( pAsciiPropName ), rValue );
+ }
+ void appendTimestamp( const ::com::sun::star::beans::Property& rProp, const ::com::sun::star::util::DateTime& rValue )
+ {
+ appendTimestamp( rProp.Name, rValue );
+ }
+
+ void appendBinaryStream( const ::rtl::OUString& rPropName, const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& rValue );
+ void appendBinaryStream( const sal_Char* pAsciiPropName, const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& rValue )
+ {
+ appendBinaryStream( ::rtl::OUString::createFromAscii( pAsciiPropName ), rValue );
+ }
+ void appendBinaryStream( const ::com::sun::star::beans::Property& rProp, const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& rValue )
+ {
+ appendBinaryStream( rProp.Name, rValue );
+ }
+
+ void appendCharacterStream( const ::rtl::OUString& rPropName, const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& rValue );
+ void appendCharacterStream( const sal_Char* pAsciiPropName, const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& rValue )
+ {
+ appendCharacterStream( ::rtl::OUString::createFromAscii( pAsciiPropName ), rValue );
+ }
+ void appendCharacterStream( const ::com::sun::star::beans::Property& rProp, const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& rValue )
+ {
+ appendCharacterStream( rProp.Name, rValue );
+ }
+
+ void appendObject( const ::rtl::OUString& rPropName, const ::com::sun::star::uno::Any& rValue );
+ void appendObject( const sal_Char* pAsciiPropName, const ::com::sun::star::uno::Any& rValue )
+ {
+ appendObject( ::rtl::OUString::createFromAscii( pAsciiPropName ), rValue );
+ }
+ void appendObject( const ::com::sun::star::beans::Property& rProp, const ::com::sun::star::uno::Any& rValue )
+ {
+ appendObject( rProp.Name, rValue );
+ }
+
+ void appendRef( const ::rtl::OUString& rPropName, const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRef >& rValue );
+ void appendRef( const sal_Char* pAsciiPropName, const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRef >& rValue )
+ {
+ appendRef( ::rtl::OUString::createFromAscii( pAsciiPropName ), rValue );
+ }
+ void appendRef( const ::com::sun::star::beans::Property& rProp, const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRef >& rValue )
+ {
+ appendRef( rProp.Name, rValue );
+ }
+
+ void appendBlob( const ::rtl::OUString& rPropName, const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XBlob >& rValue );
+ void appendBlob( const sal_Char* pAsciiPropName, const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XBlob >& rValue )
+ {
+ appendBlob( ::rtl::OUString::createFromAscii( pAsciiPropName ), rValue );
+ }
+ void appendBlob( const ::com::sun::star::beans::Property& rProp, const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XBlob >& rValue )
+ {
+ appendBlob( rProp.Name, rValue );
+ }
+
+ void appendClob( const ::rtl::OUString& rPropName, const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XClob >& rValue );
+ void appendClob( const sal_Char* pAsciiPropName, const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XClob >& rValue )
+ {
+ appendClob( ::rtl::OUString::createFromAscii( pAsciiPropName ), rValue );
+ }
+ void appendClob( const ::com::sun::star::beans::Property& rProp, const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XClob >& rValue )
+ {
+ appendClob( rProp.Name, rValue );
+ }
+
+ void appendArray( const ::rtl::OUString& rPropName, const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XArray >& rValue );
+ void appendArray( const sal_Char* pAsciiPropName, const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XArray >& rValue )
+ {
+ appendArray( ::rtl::OUString::createFromAscii( pAsciiPropName ), rValue );
+ }
+ void appendArray( const ::com::sun::star::beans::Property& rProp, const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XArray >& rValue )
+ {
+ appendArray( rProp.Name, rValue );
+ }
+
+ void appendVoid( const ::rtl::OUString& rPropName );
+ void appendVoid( const sal_Char* pAsciiPropName)
+ {
+ appendVoid( ::rtl::OUString::createFromAscii( pAsciiPropName ) );
+ }
+ void appendVoid( const ::com::sun::star::beans::Property& rProp )
+ {
+ appendVoid( rProp.Name );
+ }
+
+ /**
+ * This method tries to append all property values contained in a
+ * property set to the value set.
+ *
+ * @param rSet is a property set containing the property values.
+ */
+ void appendPropertySet( const ::com::sun::star::uno::Reference<
+ ::com::sun::star::beans::XPropertySet >& rSet );
+
+ /** This method tries to append a single property value contained in a
+ * property set to the value set.
+ *
+ * @param rSet is a property set containing the property values.
+ * @param rProperty is the property for that the value shall be obtained
+ * from the given property set.
+ * @return False, if the property value cannot be obtained from the
+ * given property pet. True, otherwise.
+ */
+ sal_Bool appendPropertySetValue(
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::beans::XPropertySet >& rSet,
+ const ::com::sun::star::beans::Property& rProperty );
+};
+
+}
+
+#endif /* !_UCBHELPER_PROPERTYVALUESET_HXX */
diff --git a/ucbhelper/inc/ucbhelper/providerhelper.hxx b/ucbhelper/inc/ucbhelper/providerhelper.hxx
new file mode 100644
index 000000000000..2c9c89294fc8
--- /dev/null
+++ b/ucbhelper/inc/ucbhelper/providerhelper.hxx
@@ -0,0 +1,285 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef _UCBHELPER_PROVIDERHELPER_HXX
+#define _UCBHELPER_PROVIDERHELPER_HXX
+
+#ifndef __LIST__
+#include <list>
+#endif
+#include <com/sun/star/ucb/XContentProvider.hpp>
+#include <com/sun/star/lang/XServiceInfo.hpp>
+#include <com/sun/star/lang/XMultiServiceFactory.hpp>
+#include <com/sun/star/lang/XTypeProvider.hpp>
+#include <cppuhelper/weak.hxx>
+
+#include "osl/mutex.hxx"
+#include "rtl/ref.hxx"
+#include <ucbhelper/macros.hxx>
+#include "ucbhelper/ucbhelperdllapi.h"
+
+//=========================================================================
+
+namespace com { namespace sun { namespace star { namespace ucb {
+ class XPropertySetRegistry;
+ class XPersistentPropertySet;
+} } } }
+
+namespace ucbhelper_impl { struct ContentProviderImplHelper_Impl; }
+
+namespace ucbhelper {
+
+//=========================================================================
+
+class ContentImplHelper;
+typedef rtl::Reference< ContentImplHelper > ContentImplHelperRef;
+typedef std::list< ContentImplHelperRef > ContentRefList;
+
+/**
+ * This is an abstract base class for implementations of the service
+ * com.sun.star.ucb.ContentProvider. It provides contents derived from
+ * class ucb::ContentImplHelper.
+ *
+ * Features of the base class implementation:
+ * - standard interfaces ( XInterface, XTypeProvider, XServiceInfo )
+ * - maintains a set of ContentImplHelper objects, which were created by
+ * the provider implementation. So there will be exactly one object for
+ * one Content Identifier.
+ * - Provides access to the Additional Core PropertySet of a content.
+ * ( These set contains the properties added to a content using its
+ * XPropertyContainer interface )
+ */
+class UCBHELPER_DLLPUBLIC ContentProviderImplHelper : public cppu::OWeakObject,
+ public com::sun::star::lang::XTypeProvider,
+ public com::sun::star::lang::XServiceInfo,
+ public com::sun::star::ucb::XContentProvider
+{
+ friend class ContentImplHelper;
+
+ ucbhelper_impl::ContentProviderImplHelper_Impl* m_pImpl;
+
+protected:
+ osl::Mutex m_aMutex;
+ ::com::sun::star::uno::Reference<
+ ::com::sun::star::lang::XMultiServiceFactory > m_xSMgr;
+
+private:
+ UCBHELPER_DLLPRIVATE void removeContent( ContentImplHelper* pContent );
+
+ UCBHELPER_DLLPRIVATE ::com::sun::star::uno::Reference<
+ ::com::sun::star::ucb::XPropertySetRegistry >
+ getAdditionalPropertySetRegistry();
+
+ UCBHELPER_DLLPRIVATE void cleanupRegisteredContents();
+
+protected:
+ /**
+ * This method returns a content with the given id, if it already exists.
+ * Use this method in your "queryContent" implementation to ensure unique
+ * objects.
+ *
+ * @param Identifier is the content identifier, for that an existing
+ * content object is requested.
+ * @return the content with the given identifier, if it exists or 0, if it
+ * does not exist.
+ */
+ rtl::Reference< ContentImplHelper >
+ queryExistingContent( const ::com::sun::star::uno::Reference<
+ ::com::sun::star::ucb::XContentIdentifier >& Identifier );
+
+ /**
+ * This method returns a content with the given URL, if it already exists.
+ *
+ * @param rURL is the URL ( content identifier string ), for that an
+ * existing content object is requested.
+ * @return the content with the given URL, if it exists or 0, if it
+ * does not exist.
+ */
+ rtl::Reference< ContentImplHelper >
+ queryExistingContent( const ::rtl::OUString& rURL );
+
+ /**
+ * This method registers a newly created content instance with the
+ * content provider. It should be called directly after creating a new
+ * content instance. The provider can reuse a registered instance upon
+ * subsedent requests for content instances with an idententifier
+ * of a registered instance.
+ * Note that the provider does not hold a hard reference on the
+ * registered instance. If last external reference is gone, the provider
+ * will remove the instance from its inventory of known instances.
+ * Nothing will happen in case an already registered instance shall
+ * be registered more than once.
+ *
+ * @param the content instance that is to be registered.
+ */
+ void registerNewContent(
+ const com::sun::star::uno::Reference<
+ ::com::sun::star::ucb::XContent > & xContent );
+
+public:
+
+ //////////////////////////////////////////////////////////////////////
+ // Contsruction/Destruction
+ //////////////////////////////////////////////////////////////////////
+
+ ContentProviderImplHelper(
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::lang::XMultiServiceFactory >& rXSMgr );
+ virtual ~ContentProviderImplHelper();
+
+ //////////////////////////////////////////////////////////////////////
+ // XInterface
+ //////////////////////////////////////////////////////////////////////
+
+ XINTERFACE_DECL()
+
+ //////////////////////////////////////////////////////////////////////
+ // XTypeProvider
+ //////////////////////////////////////////////////////////////////////
+
+ XTYPEPROVIDER_DECL()
+
+ //////////////////////////////////////////////////////////////////////
+ // XServiceInfo
+ //////////////////////////////////////////////////////////////////////
+
+ virtual ::rtl::OUString SAL_CALL
+ getImplementationName()
+ throw( ::com::sun::star::uno::RuntimeException ) = 0;
+ virtual sal_Bool SAL_CALL
+ supportsService( const ::rtl::OUString& ServiceName )
+ throw( ::com::sun::star::uno::RuntimeException );
+ virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL
+ getSupportedServiceNames()
+ throw( ::com::sun::star::uno::RuntimeException ) = 0;
+
+ //////////////////////////////////////////////////////////////////////
+ // XContentProvider
+ //////////////////////////////////////////////////////////////////////
+
+ /**
+ * This method returns a content with the requested id.
+ *
+ * The implementation should:
+ *
+ * - Check, whether the Identifier is valid ( URL syntax ).
+ * - Use queryExistingContent(...) to determine, whether there exists
+ * already a content with the given id.
+ * - Return the possibly existing content.Create and return a new
+ * content, otherwise
+ */
+ virtual ::com::sun::star::uno::Reference<
+ ::com::sun::star::ucb::XContent > SAL_CALL
+ queryContent( const ::com::sun::star::uno::Reference<
+ ::com::sun::star::ucb::XContentIdentifier >& Identifier )
+ throw( ::com::sun::star::ucb::IllegalIdentifierException,
+ ::com::sun::star::uno::RuntimeException ) = 0;
+ virtual sal_Int32 SAL_CALL
+ compareContentIds( const ::com::sun::star::uno::Reference<
+ ::com::sun::star::ucb::XContentIdentifier >& Id1,
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::ucb::XContentIdentifier >& Id2 )
+ throw( ::com::sun::star::uno::RuntimeException );
+
+ //////////////////////////////////////////////////////////////////////
+ // Non-interface methods.
+ //////////////////////////////////////////////////////////////////////
+
+ /**
+ * This method returns a mutex, which protects the content list of the
+ * provider. So you can prevent modifications of that list easyly.
+ *
+ * @return the mutex.
+ */
+ osl::Mutex& getContentListMutex() { return m_aMutex; }
+
+ /**
+ * This method fills a list with all contents existing at calling time.
+ * Note: You may prevent modifications of the content list at any time
+ * by acquiring the content list mutex of the provider.
+ *
+ * @param rContents is the list to fill with the children.
+ */
+ void queryExistingContents( ContentRefList& rContents );
+
+ /**
+ * This method returns the propertyset containing the Additional Core
+ * Properties of a content.
+ *
+ * @param rKey is the key for the propertyset.
+ * @param bCreate is a flag indicating whether the propertyset shall
+ * be created in case it does not exist.
+ * @return the propertyset containing the Additional Core Properties.
+ */
+ ::com::sun::star::uno::Reference<
+ com::sun::star::ucb::XPersistentPropertySet >
+ getAdditionalPropertySet( const ::rtl::OUString& rKey, sal_Bool bCreate );
+
+ /**
+ * This method renames the propertyset containing the Additional Core
+ * Properties of a content.
+ *
+ * @param rOldKey is the old key of the propertyset.
+ * @param rNewKey is the new key for the propertyset.
+ * @param bRecursive is a flag indicating whether propertysets for
+ * children described by rOldKey shall be renamed, too.
+ * @return True, if the operation succeeded - False, otherwise.
+ */
+ sal_Bool renameAdditionalPropertySet( const ::rtl::OUString& rOldKey,
+ const ::rtl::OUString& rNewKey,
+ sal_Bool bRecursive );
+
+ /**
+ * This method copies the propertyset containing the Additional Core
+ * Properties of a content.
+ *
+ * @param rSourceKey is the key of the source propertyset.
+ * @param rTargetKey is the key of the target propertyset.
+ * @param bRecursive is a flag indicating whether propertysets for
+ * children described by rSourceKey shall be copied, too.
+ * @return True, if the operation succeeded - False, otherwise.
+ */
+ sal_Bool copyAdditionalPropertySet( const ::rtl::OUString& rSourceKey,
+ const ::rtl::OUString& rTargetKey,
+ sal_Bool bRecursive );
+
+ /**
+ * This method removes the propertyset containing the Additional Core
+ * Properties of a content.
+ *
+ * @param rKey is the key of the propertyset.
+ * @param bRecursive is a flag indicating whether propertysets for
+ * children described by rOldKey shall be removed, too.
+ * @return True, if the operation succeeded - False, otherwise.
+ */
+ sal_Bool removeAdditionalPropertySet( const ::rtl::OUString& rKey,
+ sal_Bool bRecursive );
+};
+
+} // namespace ucbhelper
+
+#endif /* !_UCBHELPER_PROVIDERHELPER_HXX */
diff --git a/ucbhelper/inc/ucbhelper/proxydecider.hxx b/ucbhelper/inc/ucbhelper/proxydecider.hxx
new file mode 100644
index 000000000000..861a33bbf5e4
--- /dev/null
+++ b/ucbhelper/inc/ucbhelper/proxydecider.hxx
@@ -0,0 +1,143 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef _UCBHELPER_PROXYDECIDER_HXX
+#define _UCBHELPER_PROXYDECIDER_HXX
+
+#include <rtl/ustring.hxx>
+#include <com/sun/star/uno/Reference.hxx>
+#include "ucbhelper/ucbhelperdllapi.h"
+
+namespace com { namespace sun { namespace star { namespace lang {
+ class XMultiServiceFactory;
+} } } }
+
+namespace ucbhelper
+{
+
+/**
+ * This struct describes a proxy server.
+ */
+struct InternetProxyServer
+{
+ /**
+ * The name of the proxy server.
+ */
+ ::rtl::OUString aName;
+
+ /**
+ * The port of the proxy server.
+ */
+ sal_Int32 nPort;
+
+ /**
+ * Constructor.
+ */
+ InternetProxyServer() : nPort( -1 ) {}
+};
+
+namespace proxydecider_impl { class InternetProxyDecider_Impl; }
+
+/**
+ * This class is able to decide whether and which internet proxy server is to
+ * be used to access a given URI.
+ *
+ * The implementation reads the internet proxy settings from Office
+ * configuration. It listens for configuration changes and adapts itself
+ * accordingly. Because configuration data can change during runtime clients
+ * should not cache results obtained from InternetProxyDecider instances. One
+ * instance should be kept to be queried multiple times instead.
+ */
+class UCBHELPER_DLLPUBLIC InternetProxyDecider
+{
+public:
+ /**
+ * Constructor.
+ *
+ * Note: Every instance should be held alive as long as possible because
+ * because construction is quite expensive.
+ *
+ * @param rxSMgr is a Service Manager.
+ */
+ InternetProxyDecider( const ::com::sun::star::uno::Reference<
+ ::com::sun::star::lang::XMultiServiceFactory >& rxSMgr );
+
+ /**
+ * Destructor.
+ */
+ ~InternetProxyDecider();
+
+ /**
+ * Informs whether a proxy server should be used.
+ *
+ * @param rProtocol contains the internet protocol to be used to
+ * access the server (i.e. "ftp", "http"). The protocol string
+ * is handled case-insensitive and must not be empty.
+ * @param rHost contains the name of the server that should be accessed.
+ * This parameter might be left empty. In this case the
+ * implementation will return whether a proxy is configured
+ * for the given protocol.
+ * @param nPort contains the port of the server that should be accessed.
+ * If host is not empty this parameter must always contain a valid
+ * port number, for instance the default port for the requested
+ * protocol(i.e. 80 or http).
+ * @return true if a proxy server should be used, false otherwise.
+ */
+ bool
+ shouldUseProxy( const rtl::OUString & rProtocol,
+ const rtl::OUString & rHost,
+ sal_Int32 nPort ) const;
+
+ /**
+ * Returns the proxy server to be used.
+ *
+ * @param rProtocol contains the internet protocol to be used to
+ * access the server (i.e. "ftp", "http"). The protocol string
+ * is handled case-insensitive and must not be empty.
+ * @param rHost contains the name of the server that should be accessed.
+ * This parameter might be left empty. In this case the
+ * implementation will return the proxy that is configured
+ * for the given protocol.
+ * @param nPort contains the port of the server that should be accessed.
+ * If host is not empty this parameter must always contain a valid
+ * port number, for instance the default port for the requested
+ * protocol(i.e. 80 or http).
+ * @return a InternetProxyServer reference. If member aName of the
+ * InternetProxyServer is empty no proxy server is to be used.
+ */
+ const InternetProxyServer &
+ getProxy( const rtl::OUString & rProtocol,
+ const rtl::OUString & rHost,
+ sal_Int32 nPort ) const;
+
+private:
+ proxydecider_impl::InternetProxyDecider_Impl * m_pImpl;
+};
+
+} // namespace ucbhelper
+
+#endif /* !_UCBHELPER_PROXYDECIDER_HXX */
diff --git a/ucbhelper/inc/ucbhelper/registerucb.hxx b/ucbhelper/inc/ucbhelper/registerucb.hxx
new file mode 100644
index 000000000000..e2427248dce2
--- /dev/null
+++ b/ucbhelper/inc/ucbhelper/registerucb.hxx
@@ -0,0 +1,129 @@
+/*************************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+************************************************************************/
+
+#ifndef _UCBHELPER_REGISTERUCB_HXX_
+#define _UCBHELPER_REGISTERUCB_HXX_
+
+#include <com/sun/star/uno/RuntimeException.hpp>
+#include <com/sun/star/uno/Reference.h>
+#include <com/sun/star/ucb/XContentProvider.hpp>
+#include <com/sun/star/ucb/XContentProviderManager.hpp>
+#include <vector>
+
+#include "ucbhelper/ucbhelperdllapi.h"
+
+namespace com { namespace sun { namespace star {
+ namespace lang { class XMultiServiceFactory; }
+} } }
+
+namespace rtl { class OUString; }
+
+namespace ucbhelper {
+
+//============================================================================
+/** Information about a registered content provider.
+ */
+struct ContentProviderRegistrationInfo
+{
+ /** The registered content provider (or null if registration failed).
+ */
+ com::sun::star::uno::Reference< com::sun::star::ucb::XContentProvider >
+ m_xProvider;
+
+ /** The arguments the content provider was instantiated with.
+ */
+ rtl::OUString m_aArguments;
+
+ /** The URL template the content provider is registered on.
+ */
+ rtl::OUString m_aTemplate;
+};
+
+typedef std::vector< ContentProviderRegistrationInfo >
+ ContentProviderRegistrationInfoList;
+
+//============================================================================
+/** Information about a content provider, passed to
+ <method>configureUcb</method>.
+ */
+struct ContentProviderData
+{
+ /** The UNO service name to use to instanciate the content provider.
+ */
+ rtl::OUString ServiceName;
+
+ /** The URL template to use to instanciate the content provider.
+ */
+ rtl::OUString URLTemplate;
+
+ /** The arguments to use to instanciate the content provider.
+ */
+ rtl::OUString Arguments;
+
+ ContentProviderData() {};
+ ContentProviderData( const rtl::OUString & rService,
+ const rtl::OUString & rTemplate,
+ const rtl::OUString & rArgs )
+ : ServiceName( rService ), URLTemplate( rTemplate ), Arguments( rArgs ) {}
+};
+
+typedef std::vector< ContentProviderData > ContentProviderDataList;
+//============================================================================
+/** Register a content provider at a Universal Content Broker.
+
+ @param rManager A content provider manager (normally, this would be a
+ UCB). May be null, which is only useful if the content provider is an
+ <type>XParamterizedContentProvider</type>s.
+
+ @param rServiceFactory A factory through which to obtain the required
+ services.
+
+ @param rName The service name of the content provider.
+
+ @param rArguments Any arguments to instantiate the content provider with.
+
+ @param rTemplate The URL template to register the content provider on.
+
+ @param pInfo If not null, this output parameter is filled with
+ information about the (atemptively) registered provider.
+ */
+
+UCBHELPER_DLLPUBLIC bool registerAtUcb(
+ com::sun::star::uno::Reference<
+ com::sun::star::ucb::XContentProviderManager > const &
+ rManager,
+ com::sun::star::uno::Reference<
+ com::sun::star::lang::XMultiServiceFactory > const &
+ rServiceFactory,
+ rtl::OUString const & rName,
+ rtl::OUString const & rArguments,
+ rtl::OUString const & rTemplate,
+ ContentProviderRegistrationInfo * pInfo)
+ throw (com::sun::star::uno::RuntimeException);
+
+}
+#endif // _UCBHELPER_REGISTERUCB_HXX_
diff --git a/ucbhelper/inc/ucbhelper/resultset.hxx b/ucbhelper/inc/ucbhelper/resultset.hxx
new file mode 100644
index 000000000000..4835ea9f1eb0
--- /dev/null
+++ b/ucbhelper/inc/ucbhelper/resultset.hxx
@@ -0,0 +1,579 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef _UCBHELPER_RESULTSET_HXX
+#define _UCBHELPER_RESULTSET_HXX
+
+#include <com/sun/star/lang/XTypeProvider.hpp>
+#include <com/sun/star/lang/XServiceInfo.hpp>
+#include <com/sun/star/lang/XComponent.hpp>
+#include <com/sun/star/ucb/ResultSetException.hpp>
+#include <com/sun/star/ucb/XCommandEnvironment.hpp>
+#include <com/sun/star/ucb/XContentAccess.hpp>
+#include <com/sun/star/sdbc/XResultSet.hpp>
+#include <com/sun/star/sdbc/XResultSetMetaDataSupplier.hpp>
+#include <com/sun/star/sdbc/XRow.hpp>
+#include <com/sun/star/sdbc/XCloseable.hpp>
+#include <com/sun/star/beans/XPropertySet.hpp>
+
+#include "rtl/ref.hxx"
+#include "salhelper/simplereferenceobject.hxx"
+#include <cppuhelper/weak.hxx>
+#include <ucbhelper/macros.hxx>
+#include "ucbhelper/ucbhelperdllapi.h"
+
+namespace ucbhelper {
+
+//=========================================================================
+
+#define RESULTSET_SERVICE_NAME "com.sun.star.ucb.ContentResultSet"
+
+//=========================================================================
+
+class ResultSetDataSupplier;
+struct ResultSet_Impl;
+
+/**
+ * This is an implementation of the service com.sun.star.ucb.ContentResultSet.
+ * It can be used to implement the method XDynamicResultSet::getStaticResultSet,
+ * which needs to be implemented for instance to implement the command "open"
+ * at folder objects. This class uses a user supplied ResultSetDataSupplier
+ * object to request data on demand.
+ *
+ * @see ResultSetDataSupplier
+ */
+class UCBHELPER_DLLPUBLIC ResultSet :
+ public cppu::OWeakObject,
+ public com::sun::star::lang::XTypeProvider,
+ public com::sun::star::lang::XServiceInfo,
+ public com::sun::star::lang::XComponent,
+ public com::sun::star::ucb::XContentAccess,
+ public com::sun::star::sdbc::XResultSet,
+ public com::sun::star::sdbc::XResultSetMetaDataSupplier,
+ public com::sun::star::sdbc::XRow,
+ public com::sun::star::sdbc::XCloseable,
+ public com::sun::star::beans::XPropertySet
+{
+ ResultSet_Impl* m_pImpl;
+
+public:
+ /**
+ * Construction.
+ *
+ * @param rxSMgr is a Service Manager.
+ * @param rProperties is a sequence of properties for that the resultset
+ * shall be able to obtain the values.
+ * @param rDataSupplier is a supplier for the resultset data.
+ */
+ ResultSet(
+ const com::sun::star::uno::Reference<
+ com::sun::star::lang::XMultiServiceFactory >& rxSMgr,
+ const com::sun::star::uno::Sequence<
+ com::sun::star::beans::Property >& rProperties,
+ const rtl::Reference< ResultSetDataSupplier >& rDataSupplier );
+ /**
+ * Construction.
+ *
+ * @param rxSMgr is a Service Manager.
+ * @param rProperties is a sequence of properties for that the resultset
+ * shall be able to obtain the values.
+ * @param rDataSupplier is a supplier for the resultset data.
+ * @param rxEnv is the environment for interactions, progress propagation,
+ * ...
+ */
+ ResultSet(
+ const com::sun::star::uno::Reference<
+ com::sun::star::lang::XMultiServiceFactory >& rxSMgr,
+ const com::sun::star::uno::Sequence<
+ com::sun::star::beans::Property >& rProperties,
+ const rtl::Reference< ResultSetDataSupplier >& rDataSupplier,
+ const com::sun::star::uno::Reference<
+ com::sun::star::ucb::XCommandEnvironment >& rxEnv );
+ virtual ~ResultSet();
+
+ // XInterface
+ XINTERFACE_DECL()
+
+ // XTypeProvider
+ XTYPEPROVIDER_DECL()
+
+ // XServiceInfo
+ XSERVICEINFO_NOFACTORY_DECL()
+
+ // XComponent
+ virtual void SAL_CALL
+ dispose()
+ throw( com::sun::star::uno::RuntimeException );
+ virtual void SAL_CALL
+ addEventListener( const com::sun::star::uno::Reference<
+ com::sun::star::lang::XEventListener >& Listener )
+ throw( com::sun::star::uno::RuntimeException );
+ virtual void SAL_CALL
+ removeEventListener( const com::sun::star::uno::Reference<
+ com::sun::star::lang::XEventListener >& Listener )
+ throw( com::sun::star::uno::RuntimeException );
+
+ // XContentAccess
+ virtual rtl::OUString SAL_CALL
+ queryContentIdentifierString()
+ throw( com::sun::star::uno::RuntimeException );
+ virtual com::sun::star::uno::Reference<
+ com::sun::star::ucb::XContentIdentifier > SAL_CALL
+ queryContentIdentifier()
+ throw( com::sun::star::uno::RuntimeException );
+ virtual com::sun::star::uno::Reference<
+ com::sun::star::ucb::XContent > SAL_CALL
+ queryContent()
+ throw( com::sun::star::uno::RuntimeException );
+
+ // XResultSetMetaDataSupplier
+ virtual com::sun::star::uno::Reference<
+ com::sun::star::sdbc::XResultSetMetaData > SAL_CALL
+ getMetaData()
+ throw( com::sun::star::sdbc::SQLException,
+ com::sun::star::uno::RuntimeException );
+
+ // XResultSet
+ virtual sal_Bool SAL_CALL
+ next()
+ throw( com::sun::star::sdbc::SQLException,
+ com::sun::star::uno::RuntimeException );
+ virtual sal_Bool SAL_CALL
+ isBeforeFirst()
+ throw( com::sun::star::sdbc::SQLException,
+ com::sun::star::uno::RuntimeException );
+ virtual sal_Bool SAL_CALL
+ isAfterLast()
+ throw( com::sun::star::sdbc::SQLException,
+ com::sun::star::uno::RuntimeException );
+ virtual sal_Bool SAL_CALL
+ isFirst()
+ throw( com::sun::star::sdbc::SQLException,
+ com::sun::star::uno::RuntimeException );
+ virtual sal_Bool SAL_CALL
+ isLast()
+ throw( com::sun::star::sdbc::SQLException,
+ com::sun::star::uno::RuntimeException );
+ virtual void SAL_CALL
+ beforeFirst()
+ throw( com::sun::star::sdbc::SQLException,
+ com::sun::star::uno::RuntimeException );
+ virtual void SAL_CALL
+ afterLast()
+ throw( com::sun::star::sdbc::SQLException,
+ com::sun::star::uno::RuntimeException );
+ virtual sal_Bool SAL_CALL
+ first()
+ throw( com::sun::star::sdbc::SQLException,
+ com::sun::star::uno::RuntimeException );
+ virtual sal_Bool SAL_CALL
+ last()
+ throw( com::sun::star::sdbc::SQLException,
+ com::sun::star::uno::RuntimeException );
+ virtual sal_Int32 SAL_CALL
+ getRow()
+ throw( com::sun::star::sdbc::SQLException,
+ com::sun::star::uno::RuntimeException );
+ virtual sal_Bool SAL_CALL
+ absolute( sal_Int32 row )
+ throw( com::sun::star::sdbc::SQLException,
+ com::sun::star::uno::RuntimeException );
+ virtual sal_Bool SAL_CALL
+ relative( sal_Int32 rows )
+ throw( com::sun::star::sdbc::SQLException,
+ com::sun::star::uno::RuntimeException );
+ virtual sal_Bool SAL_CALL
+ previous()
+ throw( com::sun::star::sdbc::SQLException,
+ com::sun::star::uno::RuntimeException );
+ virtual void SAL_CALL
+ refreshRow()
+ throw( com::sun::star::sdbc::SQLException,
+ com::sun::star::uno::RuntimeException );
+ virtual sal_Bool SAL_CALL
+ rowUpdated()
+ throw( com::sun::star::sdbc::SQLException,
+ com::sun::star::uno::RuntimeException );
+ virtual sal_Bool SAL_CALL
+ rowInserted()
+ throw( com::sun::star::sdbc::SQLException,
+ com::sun::star::uno::RuntimeException );
+ virtual sal_Bool SAL_CALL
+ rowDeleted()
+ throw( com::sun::star::sdbc::SQLException,
+ com::sun::star::uno::RuntimeException );
+ virtual com::sun::star::uno::Reference<
+ com::sun::star::uno::XInterface > SAL_CALL
+ getStatement()
+ throw( com::sun::star::sdbc::SQLException,
+ com::sun::star::uno::RuntimeException );
+
+ // XRow
+ virtual sal_Bool SAL_CALL
+ wasNull()
+ throw( com::sun::star::sdbc::SQLException,
+ com::sun::star::uno::RuntimeException );
+ virtual rtl::OUString SAL_CALL
+ getString( sal_Int32 columnIndex )
+ throw( com::sun::star::sdbc::SQLException,
+ com::sun::star::uno::RuntimeException );
+ virtual sal_Bool SAL_CALL
+ getBoolean( sal_Int32 columnIndex )
+ throw( com::sun::star::sdbc::SQLException,
+ com::sun::star::uno::RuntimeException );
+ virtual sal_Int8 SAL_CALL
+ getByte( sal_Int32 columnIndex )
+ throw( com::sun::star::sdbc::SQLException,
+ com::sun::star::uno::RuntimeException );
+ virtual sal_Int16 SAL_CALL
+ getShort( sal_Int32 columnIndex )
+ throw( com::sun::star::sdbc::SQLException,
+ com::sun::star::uno::RuntimeException );
+ virtual sal_Int32 SAL_CALL
+ getInt( sal_Int32 columnIndex )
+ throw( com::sun::star::sdbc::SQLException,
+ com::sun::star::uno::RuntimeException );
+ virtual sal_Int64 SAL_CALL
+ getLong( sal_Int32 columnIndex )
+ throw( com::sun::star::sdbc::SQLException,
+ com::sun::star::uno::RuntimeException );
+ virtual float SAL_CALL
+ getFloat( sal_Int32 columnIndex )
+ throw( com::sun::star::sdbc::SQLException,
+ com::sun::star::uno::RuntimeException );
+ virtual double SAL_CALL
+ getDouble( sal_Int32 columnIndex )
+ throw( com::sun::star::sdbc::SQLException,
+ com::sun::star::uno::RuntimeException );
+ virtual com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL
+ getBytes( sal_Int32 columnIndex )
+ throw( com::sun::star::sdbc::SQLException,
+ com::sun::star::uno::RuntimeException );
+ virtual com::sun::star::util::Date SAL_CALL
+ getDate( sal_Int32 columnIndex )
+ throw( com::sun::star::sdbc::SQLException,
+ com::sun::star::uno::RuntimeException );
+ virtual com::sun::star::util::Time SAL_CALL
+ getTime( sal_Int32 columnIndex )
+ throw( com::sun::star::sdbc::SQLException,
+ com::sun::star::uno::RuntimeException );
+ virtual com::sun::star::util::DateTime SAL_CALL
+ getTimestamp( sal_Int32 columnIndex )
+ throw( com::sun::star::sdbc::SQLException,
+ com::sun::star::uno::RuntimeException );
+ virtual com::sun::star::uno::Reference<
+ com::sun::star::io::XInputStream > SAL_CALL
+ getBinaryStream( sal_Int32 columnIndex )
+ throw( com::sun::star::sdbc::SQLException,
+ com::sun::star::uno::RuntimeException );
+ virtual com::sun::star::uno::Reference<
+ com::sun::star::io::XInputStream > SAL_CALL
+ getCharacterStream( sal_Int32 columnIndex )
+ throw( com::sun::star::sdbc::SQLException,
+ com::sun::star::uno::RuntimeException );
+ virtual com::sun::star::uno::Any SAL_CALL
+ getObject( sal_Int32 columnIndex,
+ const com::sun::star::uno::Reference<
+ com::sun::star::container::XNameAccess >& typeMap )
+ throw( com::sun::star::sdbc::SQLException,
+ com::sun::star::uno::RuntimeException );
+ virtual com::sun::star::uno::Reference<
+ com::sun::star::sdbc::XRef > SAL_CALL
+ getRef( sal_Int32 columnIndex )
+ throw( com::sun::star::sdbc::SQLException,
+ com::sun::star::uno::RuntimeException );
+ virtual com::sun::star::uno::Reference<
+ com::sun::star::sdbc::XBlob > SAL_CALL
+ getBlob( sal_Int32 columnIndex )
+ throw( com::sun::star::sdbc::SQLException,
+ com::sun::star::uno::RuntimeException );
+ virtual com::sun::star::uno::Reference<
+ com::sun::star::sdbc::XClob > SAL_CALL
+ getClob( sal_Int32 columnIndex )
+ throw( com::sun::star::sdbc::SQLException,
+ com::sun::star::uno::RuntimeException );
+ virtual com::sun::star::uno::Reference<
+ com::sun::star::sdbc::XArray > SAL_CALL
+ getArray( sal_Int32 columnIndex )
+ throw( com::sun::star::sdbc::SQLException,
+ com::sun::star::uno::RuntimeException );
+
+ // XCloseable
+ virtual void SAL_CALL
+ close()
+ throw( com::sun::star::sdbc::SQLException,
+ com::sun::star::uno::RuntimeException );
+
+ // XPropertySet
+ virtual com::sun::star::uno::Reference<
+ com::sun::star::beans::XPropertySetInfo > SAL_CALL
+ getPropertySetInfo()
+ throw( com::sun::star::uno::RuntimeException );
+ virtual void SAL_CALL
+ setPropertyValue( const rtl::OUString& aPropertyName,
+ const com::sun::star::uno::Any& aValue )
+ throw( com::sun::star::beans::UnknownPropertyException,
+ com::sun::star::beans::PropertyVetoException,
+ com::sun::star::lang::IllegalArgumentException,
+ com::sun::star::lang::WrappedTargetException,
+ com::sun::star::uno::RuntimeException );
+ virtual com::sun::star::uno::Any SAL_CALL
+ getPropertyValue( const rtl::OUString& PropertyName )
+ throw( com::sun::star::beans::UnknownPropertyException,
+ com::sun::star::lang::WrappedTargetException,
+ com::sun::star::uno::RuntimeException );
+ virtual void SAL_CALL
+ addPropertyChangeListener( const rtl::OUString& aPropertyName,
+ const com::sun::star::uno::Reference<
+ com::sun::star::beans::XPropertyChangeListener >& xListener )
+ throw( com::sun::star::beans::UnknownPropertyException,
+ com::sun::star::lang::WrappedTargetException,
+ com::sun::star::uno::RuntimeException );
+ virtual void SAL_CALL
+ removePropertyChangeListener( const rtl::OUString& aPropertyName,
+ const com::sun::star::uno::Reference<
+ com::sun::star::beans::XPropertyChangeListener >& aListener )
+ throw( com::sun::star::beans::UnknownPropertyException,
+ com::sun::star::lang::WrappedTargetException,
+ com::sun::star::uno::RuntimeException );
+ virtual void SAL_CALL
+ addVetoableChangeListener( const rtl::OUString& PropertyName,
+ const com::sun::star::uno::Reference<
+ com::sun::star::beans::XVetoableChangeListener >& aListener )
+ throw( com::sun::star::beans::UnknownPropertyException,
+ com::sun::star::lang::WrappedTargetException,
+ com::sun::star::uno::RuntimeException );
+ virtual void SAL_CALL
+ removeVetoableChangeListener( const rtl::OUString& PropertyName,
+ const com::sun::star::uno::Reference<
+ com::sun::star::beans::XVetoableChangeListener >& aListener )
+ throw( com::sun::star::beans::UnknownPropertyException,
+ com::sun::star::lang::WrappedTargetException,
+ com::sun::star::uno::RuntimeException );
+
+ /////////////////////////////////////////////////////////////////////
+ // Non-interface methods.
+ /////////////////////////////////////////////////////////////////////
+
+ /**
+ * This method propagates property value changes to all registered
+ * listeners.
+ *
+ * @param rEvt is a property change event.
+ */
+ void propertyChanged(
+ const com::sun::star::beans::PropertyChangeEvent& rEvt );
+
+ /**
+ * This method should be called by the data supplier for the result set
+ * to indicate that there were new data obtained from the data source.
+ *
+ * @param nOld is the old count of rows; must be non-negative.
+ * @param nnew is the new count of rows; must be non-negative.
+ */
+ void rowCountChanged( sal_uInt32 nOld, sal_uInt32 nNew );
+
+ /**
+ * This method should be called by the data supplier for the result set
+ * to indicate that there were all rows obtained from the data source.
+ */
+ void rowCountFinal();
+
+ /**
+ * This method returns a sequence containing all properties ( not the
+ * values! ) of the result set.
+ *
+ * @return a sequence of properties.
+ */
+ const com::sun::star::uno::Sequence< com::sun::star::beans::Property >&
+ getProperties();
+
+ /**
+ * This method returns the environment to use for interactions, progress
+ * propagation, ... It can by empty.
+ *
+ * @return an environment or an empty reference.
+ */
+ const com::sun::star::uno::Reference<
+ com::sun::star::ucb::XCommandEnvironment >&
+ getEnvironment();
+};
+
+//=========================================================================
+
+/**
+ * This is the base class for an object that supplies data to a result set
+ *
+ * @see ResultSet
+ */
+class ResultSetDataSupplier : public salhelper::SimpleReferenceObject
+{
+ friend class ResultSet;
+
+ // No ref, otherwise we get a cyclic reference between supplier and set!
+ // Will be set from ResultSet ctor.
+ ResultSet* m_pResultSet;
+
+public:
+ ResultSetDataSupplier() : m_pResultSet( 0 ) {}
+
+ /**
+ * This method returns the resultset this supplier belongs to.
+ *
+ * @return the resultset for that the supplier supplies data.
+ */
+ rtl::Reference< ResultSet > getResultSet() const { return m_pResultSet; }
+
+ /**
+ * This method returns the identifier string of the content at the
+ * specified index.
+ *
+ * @param nIndex is the zero-based index within the logical data array
+ * of the supplier; must be non-negative.
+ * @return the content's identifier string.
+ */
+ virtual rtl::OUString queryContentIdentifierString( sal_uInt32 nIndex ) = 0;
+
+ /**
+ * This method returns the identifier of the content at the specified index.
+ *
+ * @param nIndex is the zero-based index within the logical data array
+ * of the supplier; must be non-negative.
+ * @return the content's identifier.
+ */
+ virtual com::sun::star::uno::Reference<
+ com::sun::star::ucb::XContentIdentifier >
+ queryContentIdentifier( sal_uInt32 nIndex ) = 0;
+
+ /**
+ * This method returns the the content at the specified index.
+ *
+ * @param nIndex is the zero-based index within the logical data array
+ * of the supplier; must be non-negative.
+ * @return the content.
+ */
+ virtual com::sun::star::uno::Reference< com::sun::star::ucb::XContent >
+ queryContent( sal_uInt32 nIndex ) = 0;
+
+ /**
+ * This method returns whether there is a content at the specified index.
+ *
+ * @param nIndex is the zero-based index within the logical data array
+ * of the supplier; must be non-negative.
+ * @return true, if there is a content at the given index.
+ */
+ virtual sal_Bool getResult( sal_uInt32 nIndex ) = 0;
+
+ /**
+ * This method returns the total count of objects in the logical data array
+ * of the supplier. The implementation of this method may be very
+ * "expensive", because it can be necessary to obtain all data in order
+ * to determine the count. Therefor the ResultSet implementation calls
+ * it very seldom.
+ *
+ * @return the total count of objects; will always be non-negative.
+ */
+ virtual sal_uInt32 totalCount() = 0;
+
+ /**
+ * This method returns the count of objects obtained so far. There is no
+ * for the implemetation to obtain all objects at once. It can obtain
+ * all data on demand.
+ *
+ * The implementation should call m_pResultSet->rowCountChanged(...)
+ * everytime it has inserted a new entry in its logical result array.
+ *
+ * @return the count of objects obtained so far; will always be
+ * non-negative.
+ */
+ virtual sal_uInt32 currentCount() = 0;
+
+ /**
+ * This method returns whether the value returned by currentCount() is
+ * "final". This is the case, if that there was all data obtained by the
+ * supplier and the current count won't increase any more.
+ *
+ * The implementation should call m_pResultSet->rowCountFinal(...) if
+ * it has inserted all entries in its logical result array.
+ *
+ * @return true, if the the value returned by currentCount() won't change
+ anymore.
+ */
+ virtual sal_Bool isCountFinal() = 0;
+
+ /**
+ * This method returns an object for accessing the property values at
+ * the specified index. The implementation may use the helper class
+ * ucb::PropertyValueSet to provide the return value.
+ *
+ * @param nIndex is the zero-based index within the logical data array
+ * of the supplier.
+ * @return the object for accessing the property values.
+ */
+ virtual com::sun::star::uno::Reference< com::sun::star::sdbc::XRow >
+ queryPropertyValues( sal_uInt32 nIndex ) = 0;
+
+ /**
+ * This method is called to instruct the supplier to release the (possibly
+ * presnt) property values at the given index.
+ *
+ * @param nIndex is the zero-based index within the logical data array
+ * of the supplier.
+ */
+ virtual void releasePropertyValues( sal_uInt32 nIndex ) = 0;
+
+ /**
+ * This method will be called by the resultset implementation in order
+ * to instruct the data supplier to release all resources it has
+ * allocated so far. In case the supplier is collecting data
+ * asynchronously, that process must be stopped.
+ */
+ virtual void close() = 0;
+
+ /**
+ * This method will be called by the resultset implementation in order
+ * check, whether an error has occured while collecting data. The
+ * implementation of this method must throw an exception in that case.
+ *
+ * Note: An exception thrown to indicate an error must always be thrown
+ * by the thread that created the data supplier. If the supplier collects
+ * data asynchronously ( i.e. in a separate thread ) and an error
+ * occures, throwing of the appropriate exception must be deferred
+ * until validate() is called by the ResultSet implementation from
+ * inside the main thread.
+ * In case data are obtained synchronously, the ResultSetException can
+ * be thrown directly.
+ *
+ * @exception ResultSetException thrown, if an error has occured
+ */
+ virtual void validate()
+ throw( com::sun::star::ucb::ResultSetException ) = 0;
+};
+
+}
+
+#endif /* !_UCBHELPER_RESULTSET_HXX */
diff --git a/ucbhelper/inc/ucbhelper/resultsethelper.hxx b/ucbhelper/inc/ucbhelper/resultsethelper.hxx
new file mode 100644
index 000000000000..b0c54a2779c2
--- /dev/null
+++ b/ucbhelper/inc/ucbhelper/resultsethelper.hxx
@@ -0,0 +1,220 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef _UCBHELPER_RESULTSETHELPER_HXX
+#define _UCBHELPER_RESULTSETHELPER_HXX
+
+#include <osl/mutex.hxx>
+#include <com/sun/star/lang/XMultiServiceFactory.hpp>
+#include <com/sun/star/lang/XTypeProvider.hpp>
+#include <com/sun/star/lang/XServiceInfo.hpp>
+#include <com/sun/star/ucb/XDynamicResultSet.hpp>
+#include <com/sun/star/ucb/XCommandEnvironment.hpp>
+#include <com/sun/star/ucb/OpenCommandArgument2.hpp>
+#include <cppuhelper/weak.hxx>
+#include <ucbhelper/macros.hxx>
+#include <ucbhelper/contenthelper.hxx>
+#include "ucbhelper/ucbhelperdllapi.h"
+
+namespace cppu {
+ class OInterfaceContainerHelper;
+}
+
+namespace ucbhelper {
+
+//=========================================================================
+
+#define DYNAMICRESULTSET_SERVICE_NAME "com.sun.star.ucb.DynamicResultSet"
+
+//=========================================================================
+
+/**
+ * This is an abstract base class for implementations of the service
+ * com.sun.star.ucb.DynamicResultSet, which is the result of the command
+ * "open" executed at a UCB folder content.
+ *
+ * Features of the base class implementation:
+ * - standard interfaces ( XInterface, XTypeProvider, XServiceInfo )
+ * - all required interfaces for service com::sun::star::ucb::DynamicResultSet
+ */
+class UCBHELPER_DLLPUBLIC ResultSetImplHelper :
+ public cppu::OWeakObject,
+ public com::sun::star::lang::XTypeProvider,
+ public com::sun::star::lang::XServiceInfo,
+ public com::sun::star::ucb::XDynamicResultSet
+{
+ cppu::OInterfaceContainerHelper* m_pDisposeEventListeners;
+ sal_Bool m_bStatic;
+ sal_Bool m_bInitDone;
+
+protected:
+ osl::Mutex m_aMutex;
+ com::sun::star::ucb::OpenCommandArgument2 m_aCommand;
+ com::sun::star::uno::Reference<
+ com::sun::star::lang::XMultiServiceFactory > m_xSMgr;
+ // Resultset #1
+ com::sun::star::uno::Reference<
+ com::sun::star::sdbc::XResultSet > m_xResultSet1;
+ // Resultset #2
+ com::sun::star::uno::Reference<
+ com::sun::star::sdbc::XResultSet > m_xResultSet2;
+ // Resultset changes listener.
+ com::sun::star::uno::Reference<
+ com::sun::star::ucb::XDynamicResultSetListener > m_xListener;
+
+private:
+ UCBHELPER_DLLPRIVATE void init( sal_Bool bStatic );
+
+ /**
+ * Your implementation of this method has to fill the protected member
+ * m_xResultSet1. This resultset must implement a complete static
+ * resultset ( service com.sun.star.ucb.ContentResultSet ). This method
+ * will be called at most once in the life of your implementation object.
+ * After this method was called, the type of this resultset will be
+ * "static". There is no way to change the type afterwards.
+ * If this method gets called the client wants to use your resultset
+ * exclusively statically. You may deploy this factum to optimize your
+ * implementation (i.e. "switch off" all changes detection code in
+ * your implementation).
+ * Note that you may use the class ucb::ResultSet to implement the
+ * static resultset, that is required here.
+ */
+ UCBHELPER_DLLPRIVATE virtual void initStatic() = 0;
+
+ /**
+ * Your implementation of this method has to fill the protected members
+ * m_xResultSet1 and m_xResultSet2 of this base class. Each of these
+ * resultsets must implement a complete static resultset
+ * ( service com.sun.star.ucb.ContentResultSet ). This method will be
+ * called at most once in the life of your implementation object.
+ * After this method was called, the type of this resultset will be
+ * "dynamic". There is no way to change the type afterwards.
+ * If this method gets called the client wants to use your resultset
+ * exclusively dynamically. This means, it is interested in getting
+ * notifications on changes of data of the resultset contents. ( These
+ * changes are to propagate by your implementation throw the member
+ * m_xListener of this base class ).
+ * If your implementation cannot detect changes of relevant data, you
+ * may fill m_xResultSet1 and m_xResultSet2 with the same static resultset
+ * implementation object. This normally will be the same instance you put
+ * into m_xResultSet1 when initStatic() is called.
+ */
+ UCBHELPER_DLLPRIVATE virtual void initDynamic() = 0;
+
+public:
+ /**
+ * Construtor.
+ *
+ * @param rxSMgr is a Service Manager.
+ */
+ ResultSetImplHelper(
+ const com::sun::star::uno::Reference<
+ com::sun::star::lang::XMultiServiceFactory >& rxSMgr );
+
+ /**
+ * Construtor.
+ *
+ * @param rxSMgr is a Service Manager.
+ * @param rCommand is the paramter for the open command that produces
+ * this resultset.
+ */
+ ResultSetImplHelper(
+ const com::sun::star::uno::Reference<
+ com::sun::star::lang::XMultiServiceFactory >& rxSMgr,
+ const com::sun::star::ucb::OpenCommandArgument2& rCommand );
+
+ /**
+ * Destructor.
+ */
+ virtual ~ResultSetImplHelper();
+
+ // XInterface
+ XINTERFACE_DECL()
+
+ // XTypeProvider
+ XTYPEPROVIDER_DECL()
+
+ // XServiceInfo
+ XSERVICEINFO_NOFACTORY_DECL()
+
+ // XComponent ( base class of XDynamicResultSet )
+ virtual void SAL_CALL
+ dispose()
+ throw( com::sun::star::uno::RuntimeException );
+ virtual void SAL_CALL
+ addEventListener( const com::sun::star::uno::Reference<
+ com::sun::star::lang::XEventListener >& Listener )
+ throw( com::sun::star::uno::RuntimeException );
+ virtual void SAL_CALL
+ removeEventListener( const com::sun::star::uno::Reference<
+ com::sun::star::lang::XEventListener >& Listener )
+ throw( com::sun::star::uno::RuntimeException );
+
+ // XDynamicResultSet
+ virtual com::sun::star::uno::Reference<
+ com::sun::star::sdbc::XResultSet > SAL_CALL
+ getStaticResultSet()
+ throw( com::sun::star::ucb::ListenerAlreadySetException,
+ com::sun::star::uno::RuntimeException );
+ virtual void SAL_CALL
+ setListener( const com::sun::star::uno::Reference<
+ com::sun::star::ucb::XDynamicResultSetListener >& Listener )
+ throw( com::sun::star::ucb::ListenerAlreadySetException,
+ com::sun::star::uno::RuntimeException );
+ virtual void SAL_CALL
+ connectToCache( const com::sun::star::uno::Reference<
+ com::sun::star::ucb::XDynamicResultSet > & xCache )
+ throw( com::sun::star::ucb::ListenerAlreadySetException,
+ com::sun::star::ucb::AlreadyInitializedException,
+ com::sun::star::ucb::ServiceNotFoundException,
+ com::sun::star::uno::RuntimeException );
+
+ /**
+ * The implemetation of this method always returns 0. Override this
+ * method, if necassary.
+ */
+ virtual sal_Int16 SAL_CALL
+ getCapabilities()
+ throw( com::sun::star::uno::RuntimeException );
+
+ //////////////////////////////////////////////////////////////////////
+ // Non-interface methods.
+ //////////////////////////////////////////////////////////////////////
+
+ /**
+ * This method returns, whether the resultset is static or dynamic.
+ * If neither getStatic() nor getDynamic() was called, the type
+ * of the resultset is "dynamic".
+ *
+ * @return true, if the resultset type is "static". False, otherwise.
+ */
+ sal_Bool isStatic() const { return m_bStatic; }
+};
+
+}
+
+#endif /* !_UCBHELPER_RESULTSETHELPER_HXX */
diff --git a/ucbhelper/inc/ucbhelper/resultsetmetadata.hxx b/ucbhelper/inc/ucbhelper/resultsetmetadata.hxx
new file mode 100644
index 000000000000..cc1e4b550e19
--- /dev/null
+++ b/ucbhelper/inc/ucbhelper/resultsetmetadata.hxx
@@ -0,0 +1,476 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef _UCBHELPER_RESULTSETMETADATA_HXX
+#define _UCBHELPER_RESULTSETMETADATA_HXX
+
+#include <vector>
+#include <com/sun/star/uno/Reference.hxx>
+#include <com/sun/star/uno/Sequence.hxx>
+#include <com/sun/star/lang/XTypeProvider.hpp>
+#include <com/sun/star/sdbc/ColumnValue.hpp>
+#include <com/sun/star/sdbc/XResultSetMetaData.hpp>
+#include <cppuhelper/weak.hxx>
+#include <ucbhelper/macros.hxx>
+#include "ucbhelper/ucbhelperdllapi.h"
+
+namespace com { namespace sun { namespace star {
+ namespace lang { class XMultiServiceFactory; }
+ namespace beans { struct Property; }
+} } }
+
+namespace ucbhelper_impl {
+ struct ResultSetMetaData_Impl;
+}
+
+namespace ucbhelper
+{
+
+//=========================================================================
+
+/**
+ * This is a structure that holds additional meta data for one column
+ * of a resultset. The default values set in the constructor should be a
+ * good guess for many UCB use cases.
+ */
+struct ResultSetColumnData
+{
+ /** @see ResultSetMetaData::isAutoIncrement */
+ sal_Bool isAutoIncrement;
+
+ /** @see ResultSetMetaData::isCaseSensitive */
+ sal_Bool isCaseSensitive;
+
+ /** @see ResultSetMetaData::isSearchable */
+ sal_Bool isSearchable;
+
+ /** @see ResultSetMetaData::isCurrency */
+ sal_Bool isCurrency;
+
+ /** @see ResultSetMetaData::isNullable */
+ sal_Int32 isNullable;
+
+ /** @see ResultSetMetaData::isSigned */
+ sal_Bool isSigned;
+
+ /** @see ResultSetMetaData::getColumnDisplaySize */
+ sal_Int32 columnDisplaySize;
+
+ /** @see ResultSetMetaData::getColumnLabel */
+ ::rtl::OUString columnLabel;
+
+ /** @see ResultSetMetaData::getSchemaName */
+ ::rtl::OUString schemaName;
+
+ /** @see ResultSetMetaData::getPrecision */
+ sal_Int32 precision;
+
+ /** @see ResultSetMetaData::getScale */
+ sal_Int32 scale;
+
+ /** @see ResultSetMetaData::getTableName */
+ ::rtl::OUString tableName;
+
+ /** @see ResultSetMetaData::getCatalogName */
+ ::rtl::OUString catalogName;
+
+ /** @see ResultSetMetaData::getColumnTypeName */
+ ::rtl::OUString columnTypeName;
+
+ /** @see ResultSetMetaData::isReadOnly */
+ sal_Bool isReadOnly;
+
+ /** @see ResultSetMetaData::isWritable */
+ sal_Bool isWritable;
+
+ /** @see ResultSetMetaData::isDefinitelyWritable */
+ sal_Bool isDefinitelyWritable;
+
+ /** @see ResultSetMetaData::getColumnServiceName */
+ ::rtl::OUString columnServiceName;
+
+ inline ResultSetColumnData();
+};
+
+// Note: Never change the initial values! Implementations using this struct
+// may havily depend on the behaviour of the default constructor.
+
+ResultSetColumnData::ResultSetColumnData()
+: isAutoIncrement( sal_False ),
+ isCaseSensitive( sal_True ),
+ isSearchable( sal_False ),
+ isCurrency( sal_False ),
+ isNullable( ::com::sun::star::sdbc::ColumnValue::NULLABLE ),
+ isSigned( sal_False ),
+ columnDisplaySize( 16 ),
+ precision( -1 ),
+ scale( 0 ),
+ isReadOnly( sal_True ),
+ isWritable( sal_False ),
+ isDefinitelyWritable( sal_False )
+{
+}
+
+//=========================================================================
+
+/**
+ * This is an implementation of the interface XResultSetMetaData. It can be
+ * used to implement the interface
+ * com::sun::star::sdbc::XResultSetMetaDataSupplier, which is required for
+ * implementations of service com.sun.star.ucb.ContentResultSet.
+ */
+class UCBHELPER_DLLPUBLIC ResultSetMetaData :
+ public ::cppu::OWeakObject,
+ public ::com::sun::star::lang::XTypeProvider,
+ public ::com::sun::star::sdbc::XResultSetMetaData
+{
+private:
+ ucbhelper_impl::ResultSetMetaData_Impl* m_pImpl;
+
+protected:
+ ::com::sun::star::uno::Reference<
+ ::com::sun::star::lang::XMultiServiceFactory > m_xSMgr;
+ ::com::sun::star::uno::Sequence<
+ ::com::sun::star::beans::Property > m_aProps;
+ sal_Bool m_bReadOnly;
+
+public:
+
+ /**
+ * Constructor.
+ *
+ * @param rxSMgr is a Servive Manager.
+ * @param rProps is a sequence of properties (partially) describing the
+ * columns of a resultset.
+ * @param bReadOnly is used to specify whether the whole(!) resultset
+ * is read-only.
+ */
+ ResultSetMetaData(
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::lang::XMultiServiceFactory >& rxSMgr,
+ const ::com::sun::star::uno::Sequence<
+ ::com::sun::star::beans::Property >& rProps,
+ sal_Bool bReadOnly = sal_True );
+
+ /**
+ * Constructor.
+ *
+ * @param rxSMgr is a Servive Manager.
+ * @param rProps is a sequence of properties (partially) describing the
+ * columns of a resultset.
+ * @param rColumnData contains additional meta data for the columns of
+ * a resultset, which override the default values returned by the
+ * appropriate methods of this class. The length of rColumnData
+ * must be the same as length of rProps.
+ * rColumnData[ 0 ] corresponds to data in rProps[ 0 ],
+ * rColumnData[ 1 ] corresponds to data in rProps[ 1 ], ...
+ */
+ ResultSetMetaData(
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::lang::XMultiServiceFactory >& rxSMgr,
+ const ::com::sun::star::uno::Sequence<
+ ::com::sun::star::beans::Property >& rProps,
+ const std::vector< ResultSetColumnData >& rColumnData );
+
+ /**
+ * Destructor.
+ */
+ virtual ~ResultSetMetaData();
+
+ // XInterface
+ XINTERFACE_DECL()
+
+ // XTypeProvider
+ XTYPEPROVIDER_DECL()
+
+ // XResultSetMetaData
+
+ /**
+ * Returns the number of columns of the resultset.
+ *
+ * @return the length of the property sequence.
+ */
+ virtual sal_Int32 SAL_CALL
+ getColumnCount()
+ throw( ::com::sun::star::sdbc::SQLException,
+ ::com::sun::star::uno::RuntimeException );
+ /**
+ * Checks whether column is automatically numbered, which makes it
+ * read-only.
+ *
+ * @param column is the number of the column for that a value shall
+ * be returned. The first column is 1, the second is 2, ...
+ * @return true, if column is automatically numbered.
+ */
+ virtual sal_Bool SAL_CALL
+ isAutoIncrement( sal_Int32 column )
+ throw( ::com::sun::star::sdbc::SQLException,
+ ::com::sun::star::uno::RuntimeException );
+ /**
+ * Checks whether column is case sensitive.
+ *
+ * @param column is the number of the column for that a value shall
+ * be returned. The first column is 1, the second is 2, ...
+ * @return true, if column is case sensitive.
+ */
+ virtual sal_Bool SAL_CALL
+ isCaseSensitive( sal_Int32 column )
+ throw( ::com::sun::star::sdbc::SQLException,
+ ::com::sun::star::uno::RuntimeException );
+ /**
+ * Checks whether the value stored in column can be used in a
+ * WHERE clause.
+ *
+ * @param column is the number of the column for that a value shall
+ * be returned. The first column is 1, the second is 2, ...
+ * @return true, if the column is searchable.
+ */
+ virtual sal_Bool SAL_CALL
+ isSearchable( sal_Int32 column )
+ throw( ::com::sun::star::sdbc::SQLException,
+ ::com::sun::star::uno::RuntimeException );
+ /**
+ * Checks whether column is a cash value.
+ *
+ * @param column is the number of the column for that a value shall
+ * be returned. The first column is 1, the second is 2, ...
+ * @return true, if the column is a cash value.
+ */
+ virtual sal_Bool SAL_CALL
+ isCurrency( sal_Int32 column )
+ throw( ::com::sun::star::sdbc::SQLException,
+ ::com::sun::star::uno::RuntimeException );
+ /**
+ * Checks whether a NULL can be stored in column.
+ *
+ * @see com::sun::star::sdbc::ColumnValue
+ *
+ * @param column is the number of the column for that a value shall
+ * be returned. The first column is 1, the second is 2, ...
+ * @return ::com::sun::star::sdbc::ColumnValue::NULLABLE, if a NULL
+ * can be stored in the column.
+ */
+ virtual sal_Int32 SAL_CALL
+ isNullable( sal_Int32 column )
+ throw( ::com::sun::star::sdbc::SQLException,
+ ::com::sun::star::uno::RuntimeException );
+ /**
+ * Checks whether the value stored in column is a signed number.
+ *
+ * @param column is the number of the column for that a value shall
+ * be returned. The first column is 1, the second is 2, ...
+ * @return true, if the value stored in column is a signed number.
+ */
+ virtual sal_Bool SAL_CALL
+ isSigned( sal_Int32 column )
+ throw( ::com::sun::star::sdbc::SQLException,
+ ::com::sun::star::uno::RuntimeException );
+ /**
+ * Gets the normal maximum width in characters for column.
+ *
+ * @param column is the number of the column for that a value shall
+ * be returned. The first column is 1, the second is 2, ...
+ * @return the normal maximum width in characters for column.
+ */
+ virtual sal_Int32 SAL_CALL
+ getColumnDisplaySize( sal_Int32 column )
+ throw( ::com::sun::star::sdbc::SQLException,
+ ::com::sun::star::uno::RuntimeException );
+ /**
+ * Gets the suggested column title for column, to be used in print-
+ * outs and displays.
+ *
+ * @param column is the number of the column for that a value shall
+ * be returned. The first column is 1, the second is 2, ...
+ * @return the column label.
+ */
+ virtual ::rtl::OUString SAL_CALL
+ getColumnLabel( sal_Int32 column )
+ throw( ::com::sun::star::sdbc::SQLException,
+ ::com::sun::star::uno::RuntimeException );
+ /**
+ * Gets the name of column.
+ *
+ * @param column is the number of the column for that a value shall
+ * be returned. The first column is 1, the second is 2, ...
+ * @return the name of the property that corresponds to column.
+ */
+ virtual ::rtl::OUString SAL_CALL
+ getColumnName( sal_Int32 column )
+ throw( ::com::sun::star::sdbc::SQLException,
+ ::com::sun::star::uno::RuntimeException );
+ /**
+ * Gets the schema name for the table from which column of this
+ * result set was derived.
+ * Because this feature is not widely supported, the return value
+ * for many DBMSs will be an empty string.
+ *
+ * @param column is the number of the column for that a value shall
+ * be returned. The first column is 1, the second is 2, ...
+ * @return the schema name of column or an empty string.
+ */
+ virtual ::rtl::OUString SAL_CALL
+ getSchemaName( sal_Int32 column )
+ throw( ::com::sun::star::sdbc::SQLException,
+ ::com::sun::star::uno::RuntimeException );
+ /**
+ * For number types, getprecision gets the number of decimal digits
+ * in column.
+ * For character types, it gets the maximum length in characters for
+ * column.
+ * For binary types, it gets the maximum length in bytes for column.
+ *
+ * @param column is the number of the column for that a value shall
+ * be returned. The first column is 1, the second is 2, ...
+ * @return the precision for the column.
+ */
+ virtual sal_Int32 SAL_CALL
+ getPrecision( sal_Int32 column )
+ throw( ::com::sun::star::sdbc::SQLException,
+ ::com::sun::star::uno::RuntimeException );
+ /**
+ * Gets the number of digits to the right of the decimal point for
+ * values in column.
+ *
+ * @param column is the number of the column for that a value shall
+ * be returned. The first column is 1, the second is 2, ...
+ * @return the scale of the column.
+ */
+ virtual sal_Int32 SAL_CALL
+ getScale( sal_Int32 column )
+ throw( ::com::sun::star::sdbc::SQLException,
+ ::com::sun::star::uno::RuntimeException );
+ /**
+ * Gets the name of the table from which column of this result set
+ * was derived or "" if there is none (for example, for a join).
+ * Because this feature is not widely supported, the return value
+ * for many DBMSs will be an empty string.
+ *
+ * @param column is the number of the column for that a value shall
+ * be returned. The first column is 1, the second is 2, ...
+ * @return the table name for column or an empty string.
+ */
+ virtual ::rtl::OUString SAL_CALL
+ getTableName( sal_Int32 column )
+ throw( ::com::sun::star::sdbc::SQLException,
+ ::com::sun::star::uno::RuntimeException );
+ virtual ::rtl::OUString SAL_CALL
+ /**
+ * Gets the catalog name for the table from which column of this
+ * result set was derived.
+ * Because this feature is not widely supported, the return value
+ * for many DBMSs will be an empty string.
+ *
+ * @param column is the number of the column for that a value shall
+ * be returned. The first column is 1, the second is 2, ...
+ * @return the catalog name for column or an empty string.
+ */
+ getCatalogName( sal_Int32 column )
+ throw( ::com::sun::star::sdbc::SQLException,
+ ::com::sun::star::uno::RuntimeException );
+ /**
+ * Gets the JDBC type for the value stored in column. ... The STRUCT
+ * and DISTINCT type codes are always returned for structured and
+ * distinct types, regardless of whether the value will be mapped
+ * according to the standard mapping or be a custom mapping.
+ *
+ * @param column is the number of the column for that a value shall
+ * be returned. The first column is 1, the second is 2, ...
+ * @return the type of the property that corresponds to column - mapped
+ * from UNO-Type to SQL-Type.
+ */
+ virtual sal_Int32 SAL_CALL
+ getColumnType( sal_Int32 column )
+ throw( ::com::sun::star::sdbc::SQLException,
+ ::com::sun::star::uno::RuntimeException );
+ /**
+ * Gets the type name used by this particular data source for the
+ * values stored in column. If the type code for the type of value
+ * stored in column is STRUCT, DISTINCT or JAVA_OBJECT, this method
+ * returns a fully-qualified SQL type name.
+ *
+ * @param column is the number of the column for that a value shall
+ * be returned. The first column is 1, the second is 2, ...
+ * @return the column type name.
+ */
+ virtual ::rtl::OUString SAL_CALL
+ getColumnTypeName( sal_Int32 column )
+ throw( ::com::sun::star::sdbc::SQLException,
+ ::com::sun::star::uno::RuntimeException );
+ /**
+ * Indicates whether a column is definitely not writable.
+ *
+ * @param column is the number of the column for that a value shall
+ * be returned. The first column is 1, the second is 2, ...
+ * @return true, if the column is definetely not writable.
+ */
+ virtual sal_Bool SAL_CALL
+ isReadOnly( sal_Int32 column )
+ throw( ::com::sun::star::sdbc::SQLException,
+ ::com::sun::star::uno::RuntimeException );
+ /**
+ * Indicates whether it is possible for a write on the column to succeed.
+ *
+ * @param column is the number of the column for that a value shall
+ * be returned. The first column is 1, the second is 2, ...
+ * @return true, if it is possible for a write to succeed.
+ */
+ virtual sal_Bool SAL_CALL
+ isWritable( sal_Int32 column )
+ throw( ::com::sun::star::sdbc::SQLException,
+ ::com::sun::star::uno::RuntimeException );
+ /**
+ * Indicates whether a write on the column will definitely succeed.
+ *
+ * @param column is the number of the column for that a value shall
+ * be returned. The first column is 1, the second is 2, ...
+ * @return true, if a write on the column will definetely succeed.
+ */
+ virtual sal_Bool SAL_CALL
+ isDefinitelyWritable( sal_Int32 column )
+ throw( ::com::sun::star::sdbc::SQLException,
+ ::com::sun::star::uno::RuntimeException );
+ /**
+ * Returns the fully-qualified name of the service whose instances
+ * are manufactured if the method
+ * com::sun::star::sdbc::ResultSet::getObject is called to retrieve a
+ * value from the column.
+ *
+ * @param column is the number of the column for that a value shall
+ * be returned. The first column is 1, the second is 2, ...
+ * @return the service name for column or an empty string, if no service
+ * is applicable.
+ */
+ virtual ::rtl::OUString SAL_CALL
+ getColumnServiceName( sal_Int32 column )
+ throw( ::com::sun::star::sdbc::SQLException,
+ ::com::sun::star::uno::RuntimeException );
+};
+
+} // namespace ucbhelper
+
+#endif /* !_UCBHELPER_RESULTSETMETADATA_HXX */
diff --git a/ucbhelper/inc/ucbhelper/simpleauthenticationrequest.hxx b/ucbhelper/inc/ucbhelper/simpleauthenticationrequest.hxx
new file mode 100644
index 000000000000..87fcb1b55dd7
--- /dev/null
+++ b/ucbhelper/inc/ucbhelper/simpleauthenticationrequest.hxx
@@ -0,0 +1,212 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef _UCBHELPER_SIMPLEAUTHENTICATIONREQUEST_HXX
+#define _UCBHELPER_SIMPLEAUTHENTICATIONREQUEST_HXX
+
+#include <rtl/ref.hxx>
+#include <ucbhelper/interactionrequest.hxx>
+#include "ucbhelper/ucbhelperdllapi.h"
+
+namespace com { namespace sun { namespace star { namespace ucb {
+ class URLAuthenticationRequest;
+} } } }
+
+namespace ucbhelper {
+
+/**
+ * This class implements a simple authentication interaction request.
+ * Instances can be passed directly to XInteractionHandler::handle(...). Each
+ * instance contains an AuthenticationRequest and three interaction
+ * continuations: "Abort", "Retry" and "SupplyAuthentication". The parameters
+ * for the AuthenticationRequest and the InteractionSupplyAuthentication
+ * objects are partly taken from contructors parameters and partly defaulted
+ * as follows:
+ *
+ * Read-only values : servername, realm
+ * Read-write values: username, password, account
+ * All remember-authentication values: RememberAuthentication_NO
+ *
+ * @see com::sun::star::ucb::AuthenticationRequest
+ * @see com::sun::star::ucb::RememberAuthentication
+ * @see InteractionAbort
+ * @see InteractionRetry
+ * @see InteractionSupplyAuthentication
+ */
+class UCBHELPER_DLLPUBLIC SimpleAuthenticationRequest : public ucbhelper::InteractionRequest
+{
+ rtl::Reference<
+ ucbhelper::InteractionSupplyAuthentication > m_xAuthSupplier;
+
+private:
+ void initialize( const ::com::sun::star::ucb::URLAuthenticationRequest & rRequest,
+ sal_Bool bCanSetRealm,
+ sal_Bool bCanSetUserName,
+ sal_Bool bCanSetPassword,
+ sal_Bool bCanSetAccount,
+ sal_Bool bAllowPersistentStoring,
+ sal_Bool bAllowUseSystemCredentials );
+
+public:
+ /** Specification whether some entity (realm, username, password, account)
+ is either not applicable at all, has a fixed value, or is modifiable.
+ */
+ enum EntityType
+ {
+ ENTITY_NA,
+ ENTITY_FIXED,
+ ENTITY_MODIFY
+ };
+
+ /**
+ * Constructor.
+ *
+ * @param rURL contains a URL for which authentication is requested.
+ * @param rServerName contains a server name.
+ * @param rRealm contains a realm, if applicable.
+ * @param rUserName contains a username, if available (for instance from
+ * a previous try).
+ * @param rPassword contains a password, if available (for instance from
+ * a previous try).
+ * @param rAccount contains an account, if applicable.
+ */
+ SimpleAuthenticationRequest( const rtl::OUString & rURL,
+ const rtl::OUString & rServerName,
+ const rtl::OUString & rRealm,
+ const rtl::OUString & rUserName,
+ const rtl::OUString & rPassword,
+ const rtl::OUString & rAccount
+ = rtl::OUString() );
+
+ /**
+ * Constructor.
+ *
+ * @param rURL contains a URL for which authentication is requested.
+ * @param rServerName contains a server name.
+ * @param rRealm contains a realm, if applicable.
+ * @param rUserName contains a username, if available (for instance from
+ * a previous try).
+ * @param rPassword contains a password, if available (for instance from
+ * a previous try).
+ * @param rAccount contains an account, if applicable.
+ * @param bAllowPersistentStoring specifies if the credentials should
+ * be stored in the passowrd container persistently
+ * @param bAllowUseSystemCredntials specifies if requesting client is
+ * able to obtain and use system credentials for authentication
+ */
+ SimpleAuthenticationRequest( const rtl::OUString & rURL,
+ const rtl::OUString & rServerName,
+ const rtl::OUString & rRealm,
+ const rtl::OUString & rUserName,
+ const rtl::OUString & rPassword,
+ const rtl::OUString & rAccount,
+ sal_Bool bAllowPersistentStoring,
+ sal_Bool bAllowUseSystemCredentials );
+
+
+ /**
+ * Constructor.
+ *
+ * @param rServerName contains a server name.
+ * @param eRealmType specifies whether a realm is applicable and
+ modifiable.
+ * @param rRealm contains a realm, if applicable.
+ * @param eUserNameType specifies whether a username is applicable and
+ modifiable.
+ * @param rUserName contains a username, if available (for instance from
+ * a previous try).
+ * @param ePasswordType specifies whether a password is applicable and
+ modifiable.
+ * @param rPassword contains a password, if available (for instance from
+ * a previous try).
+ * @param eAccountType specifies whether an account is applicable and
+ modifiable.
+ * @param rAccount contains an account, if applicable.
+ */
+ SimpleAuthenticationRequest( const rtl::OUString & rURL,
+ const rtl::OUString & rServerName,
+ EntityType eRealmType,
+ const rtl::OUString & rRealm,
+ EntityType eUserNameType,
+ const rtl::OUString & rUserName,
+ EntityType ePasswordType,
+ const rtl::OUString & rPassword,
+ EntityType eAccountType = ENTITY_NA,
+ const rtl::OUString & rAccount
+ = rtl::OUString() );
+
+ /**
+ * Constructor.
+ *
+ * @param rURL contains a URL for which authentication is requested.
+ * @param rServerName contains a server name.
+ * @param eRealmType specifies whether a realm is applicable and
+ modifiable.
+ * @param rRealm contains a realm, if applicable.
+ * @param eUserNameType specifies whether a username is applicable and
+ modifiable.
+ * @param rUserName contains a username, if available (for instance from
+ * a previous try).
+ * @param ePasswordType specifies whether a password is applicable and
+ modifiable.
+ * @param rPassword contains a password, if available (for instance from
+ * a previous try).
+ * @param eAccountType specifies whether an account is applicable and
+ modifiable.
+ * @param rAccount contains an account, if applicable.
+ * @param bAllowPersistentStoring specifies if the credentials should
+ * be stored in the passowrd container persistently
+ * @param bAllowUseSystemCredntials specifies if requesting client is
+ * able to obtain and use system credentials for authentication
+ */
+ SimpleAuthenticationRequest( const rtl::OUString & rURL,
+ const rtl::OUString & rServerName,
+ EntityType eRealmType,
+ const rtl::OUString & rRealm,
+ EntityType eUserNameType,
+ const rtl::OUString & rUserName,
+ EntityType ePasswordType,
+ const rtl::OUString & rPassword,
+ EntityType eAccountType,
+ const rtl::OUString & rAccount,
+ sal_Bool bAllowPersistentStoring,
+ sal_Bool bAllowUseSystemCredentials );
+
+ /**
+ * This method returns the supplier for the missing authentication data,
+ * that, for instance can be used to query the password supplied by the
+ * interaction handler.
+ *
+ * @return the supplier for the missing authentication data.
+ */
+ const rtl::Reference< ucbhelper::InteractionSupplyAuthentication > &
+ getAuthenticationSupplier() const { return m_xAuthSupplier; }
+};
+
+} // namespace ucbhelper
+
+#endif /* !_UCBHELPER_SIMPLEAUTHENTICATIONREQUEST_HXX */
diff --git a/ucbhelper/inc/ucbhelper/simplecertificatevalidationrequest.hxx b/ucbhelper/inc/ucbhelper/simplecertificatevalidationrequest.hxx
new file mode 100755
index 000000000000..213f504c7f61
--- /dev/null
+++ b/ucbhelper/inc/ucbhelper/simplecertificatevalidationrequest.hxx
@@ -0,0 +1,78 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef _UCBHELPER_SIMPLECERTIFICATEVALIDATIONREQUEST_HXX
+#define _UCBHELPER_SIMPLECERTIFICATEVALIDATIONREQUEST_HXX
+
+#include <rtl/ref.hxx>
+#include <ucbhelper/interactionrequest.hxx>
+#include "ucbhelper/ucbhelperdllapi.h"
+#include <com/sun/star/security/XCertificate.hpp>
+
+
+namespace ucbhelper {
+
+/**
+ * This class implements a simple validation interaction request of a certificate.
+ * Instances can be passed directly to XInteractionHandler::handle(...). Each
+ * instance contains an CertificateValidationRequest and two interaction
+ * continuations: "Abort" and "Approved". The parameters
+ * for the CertificateValidationRequest object are partly taken from contructors parameters and partly defaulted
+ * as follows:
+ *
+ * Read-write values: certificateValidity, certificate
+ *
+ * @see com::sun::star::ucb::CertificateValidationRequest
+ * @see InteractionApproved
+ * @see InteractionRetry
+ */
+class UCBHELPER_DLLPUBLIC SimpleCertificateValidationRequest : public ucbhelper::InteractionRequest
+{
+public:
+ /**
+ * Constructor.
+ *
+ * @param lCertificateValidity contains a bitmask which validation error occur.
+ * @param pCertificate contaisn the server certificate.
+ */
+ SimpleCertificateValidationRequest( const sal_Int32 & lCertificateValidity,
+ const com::sun::star::uno::Reference<com::sun::star::security::XCertificate> pCertificate,
+ const rtl::OUString & hostname );
+
+ /**
+ * After passing this request to XInteractionHandler::handle, this method
+ * returns the continuation that was choosen by the interaction handler.
+ *
+ * @return the continuation choosen by an interaction handler or
+ * CONTINUATION_UNKNOWN, if the request was not (yet) handled.
+ */
+ sal_Int32 getResponse() const;
+};
+
+} // namespace ucbhelper
+
+#endif /* !_UCBHELPER_SIMPLECERTIFICATEVALIDATIONREQUEST_HXX */
diff --git a/ucbhelper/inc/ucbhelper/simpleinteractionrequest.hxx b/ucbhelper/inc/ucbhelper/simpleinteractionrequest.hxx
new file mode 100644
index 000000000000..9bb1d0bff119
--- /dev/null
+++ b/ucbhelper/inc/ucbhelper/simpleinteractionrequest.hxx
@@ -0,0 +1,96 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef _UCBHELPER_SIMPLEINTERACTIONREQUEST_HXX
+#define _UCBHELPER_SIMPLEINTERACTIONREQUEST_HXX
+
+#include <ucbhelper/interactionrequest.hxx>
+#include "ucbhelper/ucbhelperdllapi.h"
+
+namespace ucbhelper {
+
+/** These are the constants that can be passed to the constructor of class
+ * SimpleInteractionRequest and that are returned by method
+ * SimpleInteractionRequest::getResponse().
+ */
+
+/** The request was not (yet) handled by the interaction handler. */
+static const sal_Int32 CONTINUATION_UNKNOWN = 0;
+
+/** The interaction handler selected XInteractionAbort. */
+static const sal_Int32 CONTINUATION_ABORT = 1;
+
+/** The interaction handler selected XInteractionRetry. */
+static const sal_Int32 CONTINUATION_RETRY = 2;
+
+/** The interaction handler selected XInteractionApprove. */
+static const sal_Int32 CONTINUATION_APPROVE = 4;
+
+/** The interaction handler selected XInteractionDisapprove. */
+static const sal_Int32 CONTINUATION_DISAPPROVE = 8;
+
+/**
+ * This class implements a simple interaction request. The user must not deal
+ * with XInteractionContinuations directly, but can use constants that are
+ * mapped internally to the according objects. This class encapsulates the
+ * standard Interaction Continuations "Abort", "Retry", "Approve" and
+ * "Disaprrove". Instances can be passed directly to
+ * XInteractionHandler::handle(...).
+ *
+ * @see InteractionRequest
+ * @see InteractionAbort
+ * @see InteractionRetry
+ * @see InteractionApprove
+ * @see InteractionDisapprove
+ */
+class UCBHELPER_DLLPUBLIC SimpleInteractionRequest : public ucbhelper::InteractionRequest
+{
+public:
+ /**
+ * Constructor.
+ *
+ * @param rRequest is the exception describing the error.
+ * @param nContinuations contains the possible "answers" for the request.
+ * This can be any of the CONTINUATION_* constants combinations
+ * listed above.
+ */
+ SimpleInteractionRequest( const com::sun::star::uno::Any & rRequest,
+ const sal_Int32 nContinuations );
+
+ /**
+ * After passing this request to XInteractionHandler::handle, this method
+ * returns the continuation that was choosen by the interaction handler.
+ *
+ * @return the continuation choosen by an interaction handler or
+ * CONTINUATION_UNKNOWN, if the request was not (yet) handled.
+ */
+ sal_Int32 getResponse() const;
+};
+
+} // namespace ucbhelper
+
+#endif /* !_UCBHELPER_SIMPLEINTERACTIONREQUEST_HXX */
diff --git a/ucbhelper/inc/ucbhelper/simpleioerrorrequest.hxx b/ucbhelper/inc/ucbhelper/simpleioerrorrequest.hxx
new file mode 100644
index 000000000000..44987fadd0aa
--- /dev/null
+++ b/ucbhelper/inc/ucbhelper/simpleioerrorrequest.hxx
@@ -0,0 +1,75 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef _UCBHELPER_SIMPLEIOERRORREQUEST_HXX
+#define _UCBHELPER_SIMPLEIOERRORREQUEST_HXX
+
+#include <com/sun/star/ucb/IOErrorCode.hpp>
+#include <ucbhelper/interactionrequest.hxx>
+
+namespace com { namespace sun { namespace star { namespace ucb {
+ class XCommandProcessor;
+} } } }
+
+namespace ucbhelper {
+
+/**
+ * This class implements a simple IO error interaction request. Instances
+ * can be passed directly to XInteractionHandler::handle(...). Each
+ * instance contains an InteractiveIOException and one interaction
+ * continuation: "Abort".
+ *
+ * @see com::sun::star::ucb::InteractiveIOException
+ * @see InteractionAbort
+ */
+class SimpleIOErrorRequest : public ucbhelper::InteractionRequest
+{
+public:
+ /**
+ * Constructor.
+ *
+ * @param xContext contains the command processor that executes the
+ * command related to the request.
+ *
+ * @param eError is the error code to pass along with the request.
+ *
+ * qparam rArgs are additional parameters according to the specification
+ * of the error code. Refer to com/sun/star/ucb/IOErrorCode.idl
+ * for details.
+ */
+ SimpleIOErrorRequest( const com::sun::star::ucb::IOErrorCode eError,
+ const com::sun::star::uno::Sequence<
+ com::sun::star::uno::Any > & rArgs,
+ const rtl::OUString & rMessage,
+ const com::sun::star::uno::Reference<
+ com::sun::star::ucb::XCommandProcessor > & xContext
+ );
+};
+
+} // namespace ucbhelper
+
+#endif /* !_UCBHELPER_SIMPLEIOERRORREQUEST_HXX */
diff --git a/ucbhelper/inc/ucbhelper/simplenameclashresolverequest.hxx b/ucbhelper/inc/ucbhelper/simplenameclashresolverequest.hxx
new file mode 100644
index 000000000000..7f3da27ece7c
--- /dev/null
+++ b/ucbhelper/inc/ucbhelper/simplenameclashresolverequest.hxx
@@ -0,0 +1,83 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef _UCBHELPER_SIMPLENAMECLASHRESOLVEREQUEST_HXX
+#define _UCBHELPER_SIMPLENAMECLASHRESOLVEREQUEST_HXX
+
+#include <rtl/ref.hxx>
+#include <ucbhelper/interactionrequest.hxx>
+#include "ucbhelper/ucbhelperdllapi.h"
+
+namespace ucbhelper {
+
+/**
+ * This class implements a simple name clash resolve interaction request.
+ * Instances can be passed directly to XInteractionHandler::handle(...). Each
+ * instance contains an NameClashResolveRequest and two interaction
+ * continuations: "Abort" and "SupplyName". Another continuation
+ * ("ReplaceExistingData") may be supplied optionally.
+ *
+ * @see com::sun::star::ucb::NameClashResolveRequest
+ * @see InteractionAbort
+ * @see InteractioneplaceExistingData
+ * @see InteractionSupplyName
+ */
+class UCBHELPER_DLLPUBLIC SimpleNameClashResolveRequest : public ucbhelper::InteractionRequest
+{
+ rtl::Reference< InteractionSupplyName > m_xNameSupplier;
+
+public:
+ /**
+ * Constructor.
+ *
+ * @param rTargetFolderURL contains the URL of the folder that contains
+ * the clashing resource.
+ * @param rClashingName contains the clashing name,
+ * @param rProposedNewName contains a proposal for the new name or is
+ * empty.
+ * @param bSupportsOverwriteData indictes whether an
+ * InteractioneplaceExistingData continuation shall be supplied
+ * with the interaction request.
+ */
+ SimpleNameClashResolveRequest( const rtl::OUString & rTargetFolderURL,
+ const rtl::OUString & rClashingName,
+ const rtl::OUString & rProposedNewName,
+ sal_Bool bSupportsOverwriteData = sal_True );
+ /**
+ * This method returns the new name that was supplied by the interaction
+ * handler.
+ *
+ * @return the new name, if supplied.
+ */
+ const rtl::OUString getNewName() const
+ { return m_xNameSupplier->getName(); }
+
+};
+
+} // namespace ucbhelper
+
+#endif /* !_UCBHELPER_SIMPLENAMECLASHRESOLVEREQUEST_HXX */
diff --git a/ucbhelper/inc/ucbhelper/ucbhelperdllapi.h b/ucbhelper/inc/ucbhelper/ucbhelperdllapi.h
new file mode 100644
index 000000000000..edb8c0ee350e
--- /dev/null
+++ b/ucbhelper/inc/ucbhelper/ucbhelperdllapi.h
@@ -0,0 +1,41 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef INCLUDED_UCBHELPERDLLAPI_H
+#define INCLUDED_UCBHELPERDLLAPI_H
+
+#include "sal/types.h"
+
+#if defined(UCBHELPER_DLLIMPLEMENTATION)
+#define UCBHELPER_DLLPUBLIC SAL_DLLPUBLIC_EXPORT
+#else
+#define UCBHELPER_DLLPUBLIC SAL_DLLPUBLIC_IMPORT
+#endif
+#define UCBHELPER_DLLPRIVATE SAL_DLLPRIVATE
+
+#endif /* INCLUDED_UCBHELPERDLLAPI_H */
+