summaryrefslogtreecommitdiff
path: root/cppuhelper/inc
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2012-09-14 19:27:00 +0200
committerStephan Bergmann <sbergman@redhat.com>2012-09-14 19:32:30 +0200
commit2171077c0c3c43a61546ab2c0ae68ba63c5112f7 (patch)
tree09461b7faec131f25b223b4bcbb2bf5b2a701763 /cppuhelper/inc
parent3ed834ae87eca0f6c486666699112a95edb74abb (diff)
Introduce cppu::supportsService helper, adapt some call-sites
...more to follow (easy hack?) Change-Id: Icb02626495701a3905c124c7368b98c3258e91b2
Diffstat (limited to 'cppuhelper/inc')
-rw-r--r--cppuhelper/inc/cppuhelper/supportsservice.hxx49
1 files changed, 49 insertions, 0 deletions
diff --git a/cppuhelper/inc/cppuhelper/supportsservice.hxx b/cppuhelper/inc/cppuhelper/supportsservice.hxx
new file mode 100644
index 000000000000..3506e374e338
--- /dev/null
+++ b/cppuhelper/inc/cppuhelper/supportsservice.hxx
@@ -0,0 +1,49 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#ifndef INCLUDED_CPPUHELPER_SUPPORTSSERVICE_HXX
+#define INCLUDED_CPPUHELPER_SUPPORTSSERVICE_HXX
+
+#include "sal/config.h"
+
+#include "cppuhelper/cppuhelperdllapi.h"
+
+namespace com { namespace sun { namespace star { namespace lang {
+ class XServiceInfo;
+} } } }
+namespace rtl { class OUString; }
+
+namespace cppu {
+
+/** A helper for implementations of com.sun.star.lang.XServiceInfo.
+
+ This function is supposed to be called from implementations of
+ com::sun::star::lang::XServiceInfo::supportsService (and therefore, for
+ easier coding takes the caller's this pointer by pointer rather than by
+ com::sun::star::uno::Reference).
+
+ @param implementation points to the service implementation whose
+ getSupportedServices method is consulted; must be non-null
+
+ @param name the service name to test
+
+ @return true iff the sequence returned by the given implementation's
+ getSupportedServices method contains the given name
+
+ @since LibreOffice 3.7
+*/
+bool CPPUHELPER_DLLPUBLIC supportsService(
+ com::sun::star::lang::XServiceInfo * implementation,
+ rtl::OUString const & name);
+
+}
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */