summaryrefslogtreecommitdiff
path: root/comphelper/inc
diff options
context:
space:
mode:
authorIvo Hinkelmann <ihi@openoffice.org>2006-08-28 14:10:14 +0000
committerIvo Hinkelmann <ihi@openoffice.org>2006-08-28 14:10:14 +0000
commit8bde35861202f765ea838dd570780398e9def4da (patch)
treef7dbf5c78d1bfa510af265e18d7082f2ac46ac1a /comphelper/inc
parent0f88b26ae22e836bb785b5debe861a83426f5dae (diff)
INTEGRATION: CWS dba205a (1.2.16); FILE MERGED
2006/07/26 08:36:19 fs 1.2.16.1: #i65420# creation of singletons
Diffstat (limited to 'comphelper/inc')
-rw-r--r--comphelper/inc/comphelper/componentcontext.hxx26
1 files changed, 24 insertions, 2 deletions
diff --git a/comphelper/inc/comphelper/componentcontext.hxx b/comphelper/inc/comphelper/componentcontext.hxx
index 62b0e9098e08..5ea01e54afd9 100644
--- a/comphelper/inc/comphelper/componentcontext.hxx
+++ b/comphelper/inc/comphelper/componentcontext.hxx
@@ -4,9 +4,9 @@
*
* $RCSfile: componentcontext.hxx,v $
*
- * $Revision: 1.2 $
+ * $Revision: 1.3 $
*
- * last change: $Author: obo $ $Date: 2006-07-10 16:14:48 $
+ * last change: $Author: ihi $ $Date: 2006-08-28 15:10:14 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
@@ -139,6 +139,11 @@ namespace comphelper
return _out_rxComponent.is();
}
+ /** creates a component using our component factory/context, passing creation arguments
+ @throws ::com::sun::star::uno::Exception
+ @return
+ <TRUE/> if and only if the component could be successfully created
+ */
template < typename INTERFACE >
bool createComponentWithArguments( const sal_Char* _pAsciiServiceName, const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& _rArguments, ::com::sun::star::uno::Reference< INTERFACE >& _out_rxComponent ) const
{
@@ -170,6 +175,23 @@ namespace comphelper
return createComponent( ::rtl::OUString::createFromAscii( _pAsciiServiceName ) );
}
+ /** retrieves a singleton instance from the context
+
+ Singletons are collected below the <code>/singletons</code> key in a component context,
+ so accessing them means retrieving the value under <code>/singletons/&lt;instance_name&gt;</code>.
+ */
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > getSingleton( const ::rtl::OUString& _rInstanceName );
+
+ /** retrieves a singleton instance from the context
+
+ Singletons are collected below the <code>/singletons</code> key in a component context,
+ so accessing them means retrieving the value under <code>/singletons/&lt;instance_name&gt;</code>.
+ */
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > getSingleton( const sal_Char* _pAsciiInstanceName )
+ {
+ return getSingleton( ::rtl::OUString::createFromAscii( _pAsciiInstanceName ) );
+ }
+
/** returns the ->XMultiServiceFactory interface of ->m_xORB, for passing to
older code which does not yet support ->XMultiComponentFactory
@throws ::com::sun::star::uno::RuntimeException