diff options
Diffstat (limited to 'odk/examples/DevelopersGuide/Components/Addons')
5 files changed, 71 insertions, 71 deletions
diff --git a/odk/examples/DevelopersGuide/Components/Addons/JobsAddon/Addons.xcu b/odk/examples/DevelopersGuide/Components/Addons/JobsAddon/Addons.xcu index d3d8d7411ed2..b97762510429 100644 --- a/odk/examples/DevelopersGuide/Components/Addons/JobsAddon/Addons.xcu +++ b/odk/examples/DevelopersGuide/Components/Addons/JobsAddon/Addons.xcu @@ -1,22 +1,22 @@ <?xml version='1.0' encoding='UTF-8'?> <oor:component-data xmlns:oor="http://openoffice.org/2001/registry" xmlns:xs="http://www.w3.org/2001/XMLSchema" oor:name="Addons" oor:package="org.openoffice.Office"> <node oor:name="AddonUI"> - + <node oor:name="AddonMenu"> - + <node oor:name="myAsyncJobAlias" oor:op="replace"> - + <prop oor:name="URL" oor:type="xs:string"> - + <value>vnd.sun.star.job:alias=AsyncJob</value> - + </prop> - + <prop oor:name="ImageIdentifier" oor:type="xs:string"> <value>private:image/3216</value> - + </prop> - + <prop oor:name="Title" oor:type="xs:string"> <!-- The x-no-translate entry is a marker to prevent l10n tooling from translation. It it is not necessary. --> <value xml:lang="x-no-translate"></value> @@ -27,20 +27,20 @@ <value>_self</value> </prop> </node> - + <node oor:name="myAsyncJobEvent" oor:op="replace"> - + <prop oor:name="URL" oor:type="xs:string"> - + <value>vnd.sun.star.job:event=onMyOwnJobEvent</value> - + </prop> - + <prop oor:name="ImageIdentifier" oor:type="xs:string"> <value>private:image/3216</value> - + </prop> - + <prop oor:name="Title" oor:type="xs:string"> <!-- The x-no-translate entry is a marker to prevent l10n tooling from translation. It it is not necessary. --> <value xml:lang="x-no-translate"></value> @@ -51,20 +51,20 @@ <value>_self</value> </prop> </node> - + <node oor:name="myAsyncJobService" oor:op="replace"> - + <prop oor:name="URL" oor:type="xs:string"> - + <value>vnd.sun.star.job:service=com.sun.star.comp.framework.java.services.AsyncJob</value> - + </prop> - + <prop oor:name="ImageIdentifier" oor:type="xs:string"> <value>private:image/3216</value> - + </prop> - + <prop oor:name="Title" oor:type="xs:string"> <!-- The x-no-translate entry is a marker to prevent l10n tooling from translation. It it is not necessary. --> <value xml:lang="x-no-translate"></value> @@ -74,7 +74,7 @@ <prop oor:name="Target" oor:type="xs:string"> <value>_self</value> </prop> - </node> + </node> </node> </node> </oor:component-data> diff --git a/odk/examples/DevelopersGuide/Components/Addons/ProtocolHandlerAddon_cpp/addon.cxx b/odk/examples/DevelopersGuide/Components/Addons/ProtocolHandlerAddon_cpp/addon.cxx index dbf2d548d7f3..de478e6711f6 100644 --- a/odk/examples/DevelopersGuide/Components/Addons/ProtocolHandlerAddon_cpp/addon.cxx +++ b/odk/examples/DevelopersGuide/Components/Addons/ProtocolHandlerAddon_cpp/addon.cxx @@ -3,7 +3,7 @@ * * The Contents of this file are made available subject to the terms of * the BSD license. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * All rights reserved. * @@ -30,7 +30,7 @@ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * + * *************************************************************************/ #include <addon.hxx> diff --git a/odk/examples/DevelopersGuide/Components/Addons/ProtocolHandlerAddon_cpp/addon.hxx b/odk/examples/DevelopersGuide/Components/Addons/ProtocolHandlerAddon_cpp/addon.hxx index f2e4a0f4a08e..63f90f2312d2 100644 --- a/odk/examples/DevelopersGuide/Components/Addons/ProtocolHandlerAddon_cpp/addon.hxx +++ b/odk/examples/DevelopersGuide/Components/Addons/ProtocolHandlerAddon_cpp/addon.hxx @@ -3,7 +3,7 @@ * * The Contents of this file are made available subject to the terms of * the BSD license. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * All rights reserved. * @@ -30,7 +30,7 @@ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * + * *************************************************************************/ #ifndef _Addon_HXX @@ -80,7 +80,7 @@ public: // XDispatchProvider virtual ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatch > - SAL_CALL queryDispatch( const ::com::sun::star::util::URL& aURL, + SAL_CALL queryDispatch( const ::com::sun::star::util::URL& aURL, const ::rtl::OUString& sTargetFrameName, sal_Int32 nSearchFlags ) throw( ::com::sun::star::uno::RuntimeException ); virtual ::com::sun::star::uno::Sequence < ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatch > > diff --git a/odk/examples/DevelopersGuide/Components/Addons/ProtocolHandlerAddon_cpp/component.cxx b/odk/examples/DevelopersGuide/Components/Addons/ProtocolHandlerAddon_cpp/component.cxx index 19553b282926..3f8596026f7d 100644 --- a/odk/examples/DevelopersGuide/Components/Addons/ProtocolHandlerAddon_cpp/component.cxx +++ b/odk/examples/DevelopersGuide/Components/Addons/ProtocolHandlerAddon_cpp/component.cxx @@ -3,7 +3,7 @@ * * The Contents of this file are made available subject to the terms of * the BSD license. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * All rights reserved. * @@ -30,7 +30,7 @@ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * + * *************************************************************************/ #include <stdio.h> @@ -45,13 +45,13 @@ // include our specific addon header to get access to functions and definitions #include <addon.hxx> - + using namespace ::rtl; using namespace ::osl; using namespace ::cppu; using namespace ::com::sun::star::uno; using namespace ::com::sun::star::lang; -using namespace ::com::sun::star::registry; +using namespace ::com::sun::star::registry; //################################################################################################## //#### EXPORTED #################################################################################### @@ -84,13 +84,13 @@ extern "C" sal_Bool SAL_CALL component_writeInfo(void * pServiceManager, void * Reference< XRegistryKey > xNewKey( reinterpret_cast< XRegistryKey * >( pRegistryKey )->createKey( OUString( RTL_CONSTASCII_USTRINGPARAM("/" IMPLEMENTATION_NAME "/UNO/SERVICES") ) ) ); - + const Sequence< OUString > & rSNL = Addon_getSupportedServiceNames(); const OUString * pArray = rSNL.getConstArray(); for ( sal_Int32 nPos = rSNL.getLength(); nPos--; ) xNewKey->createKey( pArray[nPos] ); - + return sal_True; } catch (InvalidRegistryException &) @@ -107,12 +107,12 @@ extern "C" sal_Bool SAL_CALL component_writeInfo(void * pServiceManager, void * * @param pImplName name of implementation * @param pServiceManager a service manager, need for component creation * @param pRegistryKey the registry key for this component, need for persistent data - * @return a component factory + * @return a component factory */ extern "C" void * SAL_CALL component_getFactory(const sal_Char * pImplName, void * pServiceManager, void * pRegistryKey) { void * pRet = 0; - + if (rtl_str_compare( pImplName, IMPLEMENTATION_NAME ) == 0) { Reference< XSingleServiceFactory > xFactory( createSingleFactory( @@ -120,15 +120,15 @@ extern "C" void * SAL_CALL component_getFactory(const sal_Char * pImplName, void OUString( RTL_CONSTASCII_USTRINGPARAM( IMPLEMENTATION_NAME ) ), Addon_createInstance, Addon_getSupportedServiceNames() ) ); - + if (xFactory.is()) { xFactory->acquire(); pRet = xFactory.get(); } } - + return pRet; -} +} /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/odk/examples/DevelopersGuide/Components/Addons/ProtocolHandlerAddon_java/ProtocolHandlerAddon.java b/odk/examples/DevelopersGuide/Components/Addons/ProtocolHandlerAddon_java/ProtocolHandlerAddon.java index ad3b0efe8747..2844d25e3def 100644 --- a/odk/examples/DevelopersGuide/Components/Addons/ProtocolHandlerAddon_java/ProtocolHandlerAddon.java +++ b/odk/examples/DevelopersGuide/Components/Addons/ProtocolHandlerAddon_java/ProtocolHandlerAddon.java @@ -2,7 +2,7 @@ * * The Contents of this file are made available subject to the terms of * the BSD license. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * All rights reserved. * @@ -29,7 +29,7 @@ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * + * *************************************************************************/ import com.sun.star.uno.XComponentContext; @@ -42,12 +42,12 @@ import com.sun.star.lang.XInitialization; import com.sun.star.lang.XTypeProvider; import com.sun.star.lang.XServiceInfo; import com.sun.star.uno.Type; -import com.sun.star.frame.XStatusListener; -import com.sun.star.frame.XDispatchProvider; -import com.sun.star.frame.XDispatch; -import com.sun.star.frame.XModel; -import com.sun.star.frame.XFrame; -import com.sun.star.frame.DispatchDescriptor; +import com.sun.star.frame.XStatusListener; +import com.sun.star.frame.XDispatchProvider; +import com.sun.star.frame.XDispatch; +import com.sun.star.frame.XModel; +import com.sun.star.frame.XFrame; +import com.sun.star.frame.DispatchDescriptor; import com.sun.star.awt.XToolkit; import com.sun.star.awt.XWindowPeer; import com.sun.star.awt.XMessageBox; @@ -62,14 +62,14 @@ public class ProtocolHandlerAddon { */ public static class ProtocolHandlerAddonImpl extends WeakBase implements XDispatchProvider, - XDispatch, + XDispatch, XInitialization, XServiceInfo { /** The service name, that must be used to get an instance of this service. */ static private final String[] m_serviceNames = { "com.sun.star.frame.ProtocolHandler" }; - + /** The component context, that gives access to the service manager and all registered services. */ private XComponentContext m_xCmpCtx; @@ -83,7 +83,7 @@ public class ProtocolHandlerAddon { private XFrame m_xFrame; private XStatusListener m_xStatusListener; - + /** The constructor of the inner class has a XMultiServiceFactory parameter. * @param xmultiservicefactoryInitialization A special service factory * could be introduced while initializing. @@ -91,7 +91,7 @@ public class ProtocolHandlerAddon { public ProtocolHandlerAddonImpl( XComponentContext xComponentContext ) { m_xCmpCtx = xComponentContext; } - + /** This method is a member of the interface for initializing an object * directly after its creation. * @param object This array of arbitrary objects will be passed to the @@ -114,7 +114,7 @@ public class ProtocolHandlerAddon { m_xCmpCtx.getServiceManager().createInstanceWithContext("com.sun.star.awt.Toolkit", m_xCmpCtx)); } - + /** This method returns an array of all supported service names. * @return Array of supported service names. */ @@ -125,7 +125,7 @@ public class ProtocolHandlerAddon { public static String[] getServiceNames() { return m_serviceNames; } - + /** This method returns true, if the given service will be * supported by the component. * @param stringService Service name. @@ -133,22 +133,22 @@ public class ProtocolHandlerAddon { */ public boolean supportsService( String sService ) { int len = m_serviceNames.length; - + for( int i=0; i < len; i++) { if ( sService.equals( m_serviceNames[i] ) ) return true; } - + return false; } - + /** Return the class name of the component. * @return Class name of the component. */ public String getImplementationName() { return ProtocolHandlerAddonImpl.class.getName(); } - + // XDispatchProvider public XDispatch queryDispatch( /*IN*/com.sun.star.util.URL aURL, /*IN*/String sTargetFrameName, @@ -164,23 +164,23 @@ public class ProtocolHandlerAddon { } return xRet; } - + public XDispatch[] queryDispatches( /*IN*/DispatchDescriptor[] seqDescripts ) { int nCount = seqDescripts.length; XDispatch[] lDispatcher = new XDispatch[nCount]; - + for( int i=0; i<nCount; ++i ) lDispatcher[i] = queryDispatch( seqDescripts[i].FeatureURL, seqDescripts[i].FrameName, seqDescripts[i].SearchFlags ); - - return lDispatcher; + + return lDispatcher; } // XDispatch public void dispatch( /*IN*/com.sun.star.util.URL aURL, /*IN*/com.sun.star.beans.PropertyValue[] aArguments ) { - + if ( aURL.Protocol.compareTo("org.openoffice.Office.addon.example:") == 0 ) { if ( aURL.Path.compareTo( "Function1" ) == 0 ) @@ -197,11 +197,11 @@ public class ProtocolHandlerAddon { } } } - + public void addStatusListener( /*IN*/XStatusListener xControl, /*IN*/com.sun.star.util.URL aURL ) { } - + public void removeStatusListener( /*IN*/XStatusListener xControl, /*IN*/com.sun.star.util.URL aURL ) { } @@ -221,7 +221,7 @@ public class ProtocolHandlerAddon { aDescriptor.WindowAttributes = WindowAttribute.BORDER | WindowAttribute.MOVEABLE | WindowAttribute.CLOSEABLE; - + XWindowPeer xPeer = m_xToolkit.createWindow( aDescriptor ); if ( null != xPeer ) { XMessageBox xMsgBox = (XMessageBox)UnoRuntime.queryInterface( @@ -235,12 +235,12 @@ public class ProtocolHandlerAddon { } } } catch ( com.sun.star.uno.Exception e) { - // do your error handling + // do your error handling } } } - - + + /** Gives a factory for creating the service. * This method is called by the <code>JavaLoader</code> * <p> @@ -256,14 +256,14 @@ public class ProtocolHandlerAddon { */ public static XSingleComponentFactory __getComponentFactory( String sImplementationName ) { XSingleComponentFactory xFactory = null; - + if ( sImplementationName.equals( ProtocolHandlerAddonImpl.class.getName() ) ) xFactory = Factory.createComponentFactory(ProtocolHandlerAddonImpl.class, ProtocolHandlerAddonImpl.getServiceNames()); - + return xFactory; } - + /** Writes the service information into the given registry key. * This method is called by the <code>JavaLoader</code>. * @return returns true if the operation succeeded |