summaryrefslogtreecommitdiff
path: root/toolkit
diff options
context:
space:
mode:
authorKurt Zenker <kz@openoffice.org>2008-03-06 11:06:47 +0000
committerKurt Zenker <kz@openoffice.org>2008-03-06 11:06:47 +0000
commit6ba3bd2d5d02a6b15b66763aa0c969957e14965d (patch)
tree0ff1629cb63b1e4f7a3c9bac166f766908cc7e63 /toolkit
parent2e8f518768ba1f0854a4b6ce24a87f70e305cb11 (diff)
INTEGRATION: CWS layout_DEV300 (1.1.2); FILE ADDED
2008/02/11 15:13:38 jcn 1.1.2.2: Make layout stuff in toolkit build with --enable-layout. 2008/02/08 18:44:47 jcn 1.1.2.1: Initial toolkit import from ee9a2fcc29d7e2f01cc80ef7c13bf7bc7d55ae7e. layout/source/awt -> toolkit/source/awt layout/source/core -> toolkit/source/layout layout/source/wrapper -> toolkit/source/vclcompat layout/inc/layout -> toolkit/inc/layout layout/source/inc -> toolkit/inc/layout layout/workben -> toolkit/workben/layout That's ooo-build trunk r11539 @ ooh680-m5/src680-m245.
Diffstat (limited to 'toolkit')
-rw-r--r--toolkit/workben/layout/uno.hxx79
1 files changed, 79 insertions, 0 deletions
diff --git a/toolkit/workben/layout/uno.hxx b/toolkit/workben/layout/uno.hxx
new file mode 100644
index 000000000000..ece26d1842f8
--- /dev/null
+++ b/toolkit/workben/layout/uno.hxx
@@ -0,0 +1,79 @@
+#ifndef _LAYOUT_UNO_HXX
+#define _LAYOUT_UNO_HXX
+
+#include <stdio.h>
+#include <com/sun/star/lang/XComponent.hpp>
+#include <com/sun/star/lang/XInitialization.hpp>
+#include <com/sun/star/lang/XMultiServiceFactory.hpp>
+
+#include "root.hxx"
+#include "factory.hxx"
+
+#if LAYOUT_WEAK
+#include <cppuhelper/implbase1.hxx>
+class UnoBootstrapLayout : public ::cppu::WeakImplHelper1< com::sun::star::lang::XMultiServiceFactory >
+#else /* !LAYOUT_WEAK */
+class UnoBootstrapLayout : public com::sun::star::lang::XMultiServiceFactory
+#endif /* LAYOUT_WEAK */
+{
+public:
+ com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory > mxMSF;
+ UnoBootstrapLayout( com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory > xMSF )
+ : mxMSF( xMSF )
+ {
+ fprintf( stderr, "UnoBootstrap Layout\n" );
+ }
+ virtual com::sun::star::uno::Reference< com::sun::star::uno::XInterface > SAL_CALL
+ createInstance( const rtl::OUString& aServiceSpecifier ) throw (com::sun::star::uno::Exception, com::sun::star::uno::RuntimeException)
+ {
+ if ( aServiceSpecifier.equalsAscii( "com.sun.star.awt.Layout" ) )
+ {
+ fprintf( stderr, "UnoBootstrapLayout: create service '%s'\n",
+ rtl::OUStringToOString (aServiceSpecifier, RTL_TEXTENCODING_UTF8 ).getStr() );
+ return com::sun::star::uno::Reference< com::sun::star::lang::XSingleServiceFactory >( new ::LayoutFactory( this ) );
+ }
+ else
+ {
+ fprintf( stderr, "UnoBootstrapLayout: create service '%s'\n",
+ rtl::OUStringToOString (aServiceSpecifier, RTL_TEXTENCODING_UTF8 ).getStr() );
+ try
+ {
+ return mxMSF->createInstance( aServiceSpecifier );
+ }
+ catch ( const com::sun::star::uno::Exception &rExc )
+ {
+ rtl::OString aStr( rtl::OUStringToOString( rExc.Message, RTL_TEXTENCODING_ASCII_US ) );
+ fprintf( stderr, "service construction exception '%s'\n", aStr.getStr());
+ throw rExc;
+ }
+ }
+ }
+ virtual com::sun::star::uno::Reference< com::sun::star::uno::XInterface > SAL_CALL
+ createInstanceWithArguments( const rtl::OUString& ServiceSpecifier, const com::sun::star::uno::Sequence< com::sun::star::uno::Any >& Arguments ) throw (com::sun::star::uno::Exception, com::sun::star::uno::RuntimeException)
+ {
+ return mxMSF->createInstanceWithArguments( ServiceSpecifier, Arguments );
+ }
+ virtual com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL
+ getAvailableServiceNames() throw (com::sun::star::uno::RuntimeException)
+ {
+ return mxMSF->getAvailableServiceNames();
+ }
+
+#if !LAYOUT_WEAK
+ // XInterface
+ virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException)
+ {
+ return mxMSF->queryInterface( rType );
+ }
+ virtual void SAL_CALL acquire() throw()
+ {
+ mxMSF->acquire();
+ }
+ virtual void SAL_CALL release() throw()
+ {
+ mxMSF->release();
+ }
+#endif /* !LAYOUT_WEAK */
+};
+
+#endif /* _LAYOUT_UNO_HXX */