summaryrefslogtreecommitdiff
path: root/chart2/source/inc/ThreeDHelper.hxx
blob: 2c43fff6c71aa741edf9381223dcd944ba03184b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
/* -*- 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/.
 *
 * This file incorporates work covered by the following license notice:
 *
 *   Licensed to the Apache Software Foundation (ASF) under one or more
 *   contributor license agreements. See the NOTICE file distributed
 *   with this work for additional information regarding copyright
 *   ownership. The ASF licenses this file to you under the Apache
 *   License, Version 2.0 (the "License"); you may not use this file
 *   except in compliance with the License. You may obtain a copy of
 *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
 */

#pragma once

#include <config_options.h>
#include <com/sun/star/drawing/CameraGeometry.hpp>
#include <rtl/ref.hxx>
#include "charttoolsdllapi.hxx"

namespace com::sun::star::beans { class XPropertySet; }
namespace com::sun::star::chart2 { class XDiagram; }

namespace chart
{
class Diagram;

enum class ThreeDLookScheme
{
    ThreeDLookScheme_Simple,
    ThreeDLookScheme_Realistic,
    ThreeDLookScheme_Unknown
};

enum CuboidPlanePosition
{
    CuboidPlanePosition_Left,
    CuboidPlanePosition_Right,
    CuboidPlanePosition_Top,
    CuboidPlanePosition_Bottom,
    CuboidPlanePosition_Front,
    CuboidPlanePosition_Back
};

class UNLESS_MERGELIBS(OOO_DLLPUBLIC_CHARTTOOLS) ThreeDHelper
{
public:

    /** Returns the default camera geometry that is set in the Diagram CTOR.
        This is not the property default!

        @todo deprecate the hard set camera geometry and use the property
              default
     */
    static css::drawing::CameraGeometry getDefaultCameraGeometry( bool bPie=false );

    static void adaptRadAnglesForRightAngledAxes( double& rfXAngleRad, double& rfYAngleRad );
    static double getXDegreeAngleLimitForRightAngledAxes() { return 90.0; }
    static double getYDegreeAngleLimitForRightAngledAxes() { return 45.0; }

    static double getValueClippedToRange( double fValue, const double& fPositivLimit );

    static void convertElevationRotationDegToXYZAngleRad(
        sal_Int32 nElevationDeg, sal_Int32 nRotationDeg
        , double& rfXAngleRad, double& rfYAngleRad, double& rfZAngleRad );

    SAL_DLLPRIVATE static void convertXYZAngleRadToElevationRotationDeg(
        sal_Int32& rnElevationDeg, sal_Int32& rnRotationDeg
        , double fXRad, double fYRad, double fZRad );

    SAL_DLLPRIVATE static void ensureCameraDistanceRange( double& rfCameraDistance );
    SAL_DLLPRIVATE static void getCameraDistanceRange( double& rfMinimumDistance, double& rfMaximumDistance );

    static double CameraDistanceToPerspective( double fCameraDistance );
    static double PerspectiveToCameraDistance( double fPerspective );

    static CuboidPlanePosition getAutomaticCuboidPlanePositionForStandardLeftWall( const rtl::Reference<
            ::chart::Diagram >& xDiagram );
    static CuboidPlanePosition getAutomaticCuboidPlanePositionForStandardBackWall(const rtl::Reference<
            ::chart::Diagram >& xDiagram );
    static CuboidPlanePosition getAutomaticCuboidPlanePositionForStandardBottom(const rtl::Reference<
            ::chart::Diagram >& xDiagram );

    //sal_Int32 nRoundedEdges:  <0 or >100 -> mixed state
    //sal_Int32 nObjectLines:  0->no lines; 1->all lines on; other->mixed state

    static void getRoundedEdgesAndObjectLines( const rtl::Reference< ::chart::Diagram >& xDiagram
            , sal_Int32& rnRoundedEdges, sal_Int32& rnObjectLines );
    static void setRoundedEdgesAndObjectLines( const rtl::Reference< ::chart::Diagram >& xDiagram
            , sal_Int32 nRoundedEdges, sal_Int32 nObjectLines );
};

} //namespace chart

/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
6b1cc0422de29'>ridljar/com/sun/star/comp/servicemanager/ServiceManager.java662
-rw-r--r--ridljar/com/sun/star/comp/urlresolver/UrlResolver.java147
-rw-r--r--ridljar/com/sun/star/lib/connections/pipe/PipeConnection.java213
-rw-r--r--ridljar/com/sun/star/lib/connections/pipe/pipeAcceptor.java123
-rw-r--r--ridljar/com/sun/star/lib/connections/pipe/pipeConnector.java120
-rw-r--r--ridljar/com/sun/star/lib/connections/socket/ConnectionDescriptor.java98
-rw-r--r--ridljar/com/sun/star/lib/connections/socket/SocketConnection.java235
-rw-r--r--ridljar/com/sun/star/lib/connections/socket/socketAcceptor.java202
-rw-r--r--ridljar/com/sun/star/lib/connections/socket/socketConnector.java176
-rw-r--r--ridljar/com/sun/star/lib/uno/Proxy.java34
-rw-r--r--ridljar/com/sun/star/lib/uno/bridges/java_remote/BridgedObject.java43
-rw-r--r--ridljar/com/sun/star/lib/uno/bridges/java_remote/ProxyFactory.java198
-rw-r--r--ridljar/com/sun/star/lib/uno/bridges/java_remote/RequestHandler.java35
-rw-r--r--ridljar/com/sun/star/lib/uno/bridges/java_remote/XConnectionInputStream_Adapter.java76
-rw-r--r--ridljar/com/sun/star/lib/uno/bridges/java_remote/XConnectionOutputStream_Adapter.java89
-rw-r--r--ridljar/com/sun/star/lib/uno/bridges/java_remote/java_remote_bridge.java700
-rw-r--r--ridljar/com/sun/star/lib/uno/environments/java/java_environment.java312
-rw-r--r--ridljar/com/sun/star/lib/uno/environments/remote/IProtocol.java93
-rw-r--r--ridljar/com/sun/star/lib/uno/environments/remote/IReceiver.java40
-rw-r--r--ridljar/com/sun/star/lib/uno/environments/remote/IThreadPool.java115
-rw-r--r--ridljar/com/sun/star/lib/uno/environments/remote/JavaThreadPool.java124
-rw-r--r--ridljar/com/sun/star/lib/uno/environments/remote/JavaThreadPoolFactory.java87
-rw-r--r--ridljar/com/sun/star/lib/uno/environments/remote/Job.java163
-rw-r--r--ridljar/com/sun/star/lib/uno/environments/remote/JobQueue.java373
-rw-r--r--ridljar/com/sun/star/lib/uno/environments/remote/Message.java189
-rw-r--r--ridljar/com/sun/star/lib/uno/environments/remote/NativeThreadPool.java94
-rw-r--r--ridljar/com/sun/star/lib/uno/environments/remote/ThreadId.java109
-rw-r--r--ridljar/com/sun/star/lib/uno/environments/remote/ThreadPoolManager.java74
-rw-r--r--ridljar/com/sun/star/lib/uno/environments/remote/remote_environment.java66
-rw-r--r--ridljar/com/sun/star/lib/uno/protocols/urp/Cache.java114
-rw-r--r--ridljar/com/sun/star/lib/uno/protocols/urp/Marshal.java355
-rw-r--r--ridljar/com/sun/star/lib/uno/protocols/urp/PendingRequests.java65
-rw-r--r--ridljar/com/sun/star/lib/uno/protocols/urp/Unmarshal.java476
-rw-r--r--ridljar/com/sun/star/lib/uno/protocols/urp/UrpMessage.java48
-rw-r--r--ridljar/com/sun/star/lib/uno/protocols/urp/urp.java760
-rw-r--r--ridljar/com/sun/star/lib/util/AsynchronousFinalizer.java117
-rw-r--r--ridljar/com/sun/star/lib/util/NativeLibraryLoader.java132
-rw-r--r--ridljar/com/sun/star/lib/util/StringHelper.java46
-rw-r--r--ridljar/com/sun/star/lib/util/UrlToFileMapper.java94
-rw-r--r--ridljar/com/sun/star/uno/AnyConverter.java668
-rw-r--r--ridljar/com/sun/star/uno/Ascii.java43
-rw-r--r--ridljar/com/sun/star/uno/AsciiString.java44
-rw-r--r--ridljar/com/sun/star/uno/MappingException.java65
-rw-r--r--ridljar/com/sun/star/uno/WeakReference.java154
54 files changed, 10238 insertions, 0 deletions
diff --git a/ridljar/com/sun/star/comp/bridgefactory/BridgeFactory.java b/ridljar/com/sun/star/comp/bridgefactory/BridgeFactory.java
new file mode 100644
index 000000000000..031e60d3f1dc
--- /dev/null
+++ b/ridljar/com/sun/star/comp/bridgefactory/BridgeFactory.java
@@ -0,0 +1,212 @@
+/* -*- Mode: Java; 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/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+package com.sun.star.comp.bridgefactory;
+
+import java.math.BigInteger;
+import java.util.ArrayList;
+
+import com.sun.star.bridge.BridgeExistsException;
+import com.sun.star.bridge.XBridge;
+import com.sun.star.bridge.XBridgeFactory;
+import com.sun.star.bridge.XInstanceProvider;
+import com.sun.star.comp.loader.FactoryHelper;
+import com.sun.star.connection.XConnection;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.lang.XSingleServiceFactory;
+import com.sun.star.registry.XRegistryKey;
+import com.sun.star.uno.IBridge;
+import com.sun.star.uno.UnoRuntime;
+
+
+/**
+ * The BridgeFactory class implements the <code>XBridgeFactory</code> Interface.
+ *
+ * <p>It wraps the <code>UnoRuntime#getBridgeByName</code>method and delivers a
+ * XBridge component.</p>
+ *
+ * <p>This component is only usable for remote bridges.</p>
+ *
+ * @see com.sun.star.uno.UnoRuntime
+ * @since UDK1.0
+ */
+public class BridgeFactory implements XBridgeFactory/*, XEventListener*/ {
+ private static final boolean DEBUG = false;
+
+ /**
+ * The name of the service, the <code>JavaLoader</code> accesses this through
+ * reflection.
+ */
+ public static final String __serviceName = "com.sun.star.bridge.BridgeFactory";
+
+ /**
+ * Gives a factory for creating the service.
+ *
+ * <p>This method is called by the <code>JavaLoader</code>.</p>
+ *
+ * @param implName the name of the implementation for which a service is desired.
+ * @param multiFactory the service manager to be uses if needed.
+ * @param regKey the registryKey.
+ * @return returns a <code>XSingleServiceFactory</code> for creating the component.
+ *
+ * @see com.sun.star.comp.loader.JavaLoader
+ */
+ public static XSingleServiceFactory __getServiceFactory(String implName,
+ XMultiServiceFactory multiFactory,
+ XRegistryKey regKey)
+ {
+ XSingleServiceFactory xSingleServiceFactory = null;
+
+ if (implName.equals(BridgeFactory.class.getName()) )
+ xSingleServiceFactory = FactoryHelper.getServiceFactory(BridgeFactory.class,
+ multiFactory,
+ regKey);
+
+ return xSingleServiceFactory;
+ }
+
+ /**
+ * Creates a remote bridge and memorizes it under <code>sName</code>.
+ *
+ * @param sName the name to memorize the bridge.
+ * @param sProtocol the protocol the bridge should use.
+ * @param anInstanceProvider the instance provider.
+ * @return the bridge.
+ *
+ * @see com.sun.star.bridge.XBridgeFactory
+ */
+ public XBridge createBridge(String sName, String sProtocol, XConnection aConnection, XInstanceProvider anInstanceProvider) throws
+ BridgeExistsException,
+ com.sun.star.lang.IllegalArgumentException,
+ com.sun.star.uno.RuntimeException
+ {
+ boolean hasName = sName.length() != 0;
+ Object context = hasName ? sName : new UniqueToken();
+ // UnoRuntime.getBridgeByName internally uses context.toString() to
+ // distinguish bridges, so the result of
+ // new UniqueToken().toString() might clash with an explicit
+ // sName.toString(), but the UnoRuntime bridge management is
+ // obsolete anyway and should be removed
+
+ // do not create a new bridge, if one already exists
+ if (hasName) {
+ IBridge iBridges[] = UnoRuntime.getBridges();
+ for(int i = 0; i < iBridges.length; ++ i) {
+ XBridge xBridge = UnoRuntime.queryInterface(XBridge.class, iBridges[i]);
+
+ if(xBridge != null && xBridge.getName().equals(sName)) {
+ throw new BridgeExistsException(sName + " already exists");
+ }
+ }
+ }
+
+ XBridge xBridge;
+
+ try {
+ IBridge iBridge = UnoRuntime.getBridgeByName("java", context, "remote", context, hasName ? new Object[]{sProtocol, aConnection, anInstanceProvider, sName} : new Object[]{sProtocol, aConnection, anInstanceProvider});
+
+ xBridge = UnoRuntime.queryInterface(XBridge.class, iBridge);
+ }
+ catch (Exception e) {
+ throw new com.sun.star.lang.IllegalArgumentException(e, e.getMessage());
+ }
+
+ if(DEBUG) System.err.println("##### " + getClass().getName() + ".createBridge:" + sName + " " + sProtocol + " " + aConnection + " " + anInstanceProvider + " " + xBridge);
+
+ return xBridge;
+ }
+
+ /**
+ * Gets a remote bridge which must already exist.
+ *
+ * @param sName the name of the bridge.
+ * @return the bridge.
+ * @see com.sun.star.bridge.XBridgeFactory
+ */
+ public XBridge getBridge(String sName) throws com.sun.star.uno.RuntimeException {
+ XBridge xBridge = null;
+
+ IBridge iBridges[] = UnoRuntime.getBridges();
+ for(int i = 0; i < iBridges.length; ++ i) {
+ xBridge = UnoRuntime.queryInterface(XBridge.class, iBridges[i]);
+
+ if(xBridge != null) {
+ if(xBridge.getName().equals(sName))
+ break;
+
+ else
+ xBridge = null;
+ }
+ }
+
+
+ if(DEBUG) System.err.println("##### " + getClass().getName() + ".getBridge:" + sName + " " + xBridge);
+
+ return xBridge;
+ }
+
+ /**
+ * Gives all created bridges.
+ *
+ * @return the bridges.
+ * @see com.sun.star.bridge.XBridgeFactory
+ */
+ public synchronized XBridge[] getExistingBridges() throws com.sun.star.uno.RuntimeException {
+ ArrayList<XBridge> vector = new ArrayList<XBridge>();
+
+ IBridge iBridges[] = UnoRuntime.getBridges();
+ for(int i = 0; i < iBridges.length; ++ i) {
+ XBridge xBridge = UnoRuntime.queryInterface(XBridge.class, iBridges[i]);
+
+ if(xBridge != null)
+ vector.add(xBridge);
+ }
+
+ XBridge xBridges[]= new XBridge[vector.size()];
+ for(int i = 0; i < vector.size(); ++ i)
+ xBridges[i] = vector.get(i);
+
+ return xBridges;
+ }
+
+ private static final class UniqueToken {
+ public UniqueToken() {
+ synchronized (UniqueToken.class) {
+ token = counter.toString();
+ counter = counter.add(BigInteger.ONE);
+ }
+ }
+
+ /**
+ * Returns a string representation of the object.
+ *
+ * @return a string representation of the object.
+ * @see java.lang.Object#toString
+ */
+ @Override
+ public String toString() {
+ return token;
+ }
+
+ private final String token;
+ private static BigInteger counter = BigInteger.ZERO;
+ }
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/ridljar/com/sun/star/comp/connections/Acceptor.java b/ridljar/com/sun/star/comp/connections/Acceptor.java
new file mode 100644
index 000000000000..996eaeb858d7
--- /dev/null
+++ b/ridljar/com/sun/star/comp/connections/Acceptor.java
@@ -0,0 +1,153 @@
+/* -*- Mode: Java; 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/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+package com.sun.star.comp.connections;
+
+import com.sun.star.comp.loader.FactoryHelper;
+import com.sun.star.connection.AlreadyAcceptingException;
+import com.sun.star.connection.ConnectionSetupException;
+import com.sun.star.connection.XAcceptor;
+import com.sun.star.connection.XConnection;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.lang.XSingleServiceFactory;
+import com.sun.star.registry.XRegistryKey;
+
+/**
+ * A component that implements the <code>XAcceptor</code> interface.
+ *
+ * <p>The <code>Acceptor</code> is a general component, that uses less general
+ * components (like <code>com.sun.star.connection.socketAcceptor</code>) to
+ * implement its functionality.</p>
+ *
+ * @see com.sun.star.connection.XAcceptor
+ * @see com.sun.star.connection.XConnection
+ * @see com.sun.star.connection.XConnector
+ * @see com.sun.star.comp.loader.JavaLoader
+ *
+ * @since UDK 1.0
+ */
+public final class Acceptor implements XAcceptor {
+ /**
+ * The name of the service.
+ *
+ * <p>The <code>JavaLoader</code> accesses this through reflection.</p>
+ *
+ * @see com.sun.star.comp.loader.JavaLoader
+ */
+ public static final String __serviceName
+ = "com.sun.star.connection.Acceptor";
+
+ /**
+ * Returns a factory for creating the service.
+ *
+ * <p>This method is called by the <code>JavaLoader</code>.</p>
+ *
+ * @param implName the name of the implementation for which a service is
+ * requested.
+ * @param multiFactory the service manager to be used (if needed).
+ * @param regKey the registry key.
+ * @return an <code>XSingleServiceFactory</code> for creating the component.
+ *
+ * @see com.sun.star.comp.loader.JavaLoader
+ */
+ public static XSingleServiceFactory __getServiceFactory(
+ String implName, XMultiServiceFactory multiFactory, XRegistryKey regKey)
+ {
+ return implName.equals(Acceptor.class.getName())
+ ? FactoryHelper.getServiceFactory(Acceptor.class, __serviceName,
+ multiFactory, regKey)
+ : null;
+ }
+
+ /**
+ * Constructs a new <code>Acceptor</code> that uses the given service
+ * factory to create a specific <code>XAcceptor</code>.
+ *
+ * @param serviceFactory the service factory to use.
+ */
+ public Acceptor(XMultiServiceFactory serviceFactory) {
+ this.serviceFactory = serviceFactory;
+ }
+
+ /**
+ * Accepts a connection request via the given connection type.
+ *
+ * <p>This call blocks until a connection has been established.</p>
+ *
+ * <p>The connection description has the following format:
+ * <code><var>type</var></code><!--
+ * -->*(<code><var>key</var>=<var>value</var></code>).
+ * The specific <code>XAcceptor</code> implementation is instantiated
+ * through the service factory as
+ * <code>com.sun.star.connection.<var>type</var>Acceptor</code> (with
+ * <code><var>type</var></code> in lower case).</p>
+ *
+ * @param connectionDescription the description of the connection.
+ * @return an <code>XConnection</code> to the client.
+ *
+ * @see com.sun.star.connection.XConnection
+ * @see com.sun.star.connection.XConnector
+ */
+ public XConnection accept(String connectionDescription) throws
+ AlreadyAcceptingException, ConnectionSetupException,
+ com.sun.star.lang.IllegalArgumentException
+ {
+ if (DEBUG) {
+ System.err.println("##### " + getClass().getName() + ".accept("
+ + connectionDescription + ")");
+ }
+ XAcceptor acc;
+ synchronized (this) {
+ if (acceptor == null) {
+ acceptor = (XAcceptor) Implementation.getConnectionService(
+ serviceFactory, connectionDescription, XAcceptor.class,
+ "Acceptor");
+ acceptingDescription = connectionDescription;
+ } else if (!connectionDescription.equals(acceptingDescription)) {
+ throw new AlreadyAcceptingException(acceptingDescription
+ + " vs. "
+ + connectionDescription);
+ }
+ acc = acceptor;
+ }
+ return acc.accept(connectionDescription);
+ }
+
+ /**
+ *
+ * @see com.sun.star.connection.XAcceptor#stopAccepting
+ */
+ public void stopAccepting() {
+ XAcceptor acc;
+ synchronized (this) {
+ acc = acceptor;
+ }
+ acc.stopAccepting();
+ }
+
+ private static final boolean DEBUG = false;
+
+ private final XMultiServiceFactory serviceFactory;
+
+ private XAcceptor acceptor = null;
+ private String acceptingDescription;
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+
diff --git a/ridljar/com/sun/star/comp/connections/Connector.java b/ridljar/com/sun/star/comp/connections/Connector.java
new file mode 100644
index 000000000000..6ffab9eea86b
--- /dev/null
+++ b/ridljar/com/sun/star/comp/connections/Connector.java
@@ -0,0 +1,130 @@
+/* -*- Mode: Java; 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/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+package com.sun.star.comp.connections;
+
+import com.sun.star.comp.loader.FactoryHelper;
+import com.sun.star.connection.ConnectionSetupException;
+import com.sun.star.connection.NoConnectException;
+import com.sun.star.connection.XConnection;
+import com.sun.star.connection.XConnector;
+import com.sun.star.lang.XMultiServiceFactory;
+import com.sun.star.lang.XSingleServiceFactory;
+import com.sun.star.registry.XRegistryKey;
+
+/**
+ * A component that implements the <code>XConnector</code> interface.
+ *
+ * <p>The <code>Connector</code> is a general component, that uses less general
+ * components (like <code>com.sun.star.connection.socketConnector</code>) to
+ * implement its functionality.</p>
+ *
+ * @see com.sun.star.connection.XAcceptor
+ * @see com.sun.star.connection.XConnection
+ * @see com.sun.star.connection.XConnector
+ * @see com.sun.star.comp.loader.JavaLoader
+ *
+ * @since UDK 1.0
+ */
+public class Connector implements XConnector {
+ /**
+ * The name of the service.
+ *
+ * <p>The <code>JavaLoader</code> accesses this through reflection.</p>
+ *
+ * @see com.sun.star.comp.loader.JavaLoader
+ */
+ public static final String __serviceName
+ = "com.sun.star.connection.Connector";
+
+ /**
+ * Returns a factory for creating the service.
+ *
+ * <p>This method is called by the <code>JavaLoader</code>.</p>
+ *
+ * @param implName the name of the implementation for which a service is
+ * requested.
+ * @param multiFactory the service manager to be used (if needed).
+ * @param regKey the registry key.
+ * @return an <code>XSingleServiceFactory</code> for creating the component.
+ *
+ * @see com.sun.star.comp.loader.JavaLoader
+ */
+ public static XSingleServiceFactory __getServiceFactory(
+ String implName, XMultiServiceFactory multiFactory, XRegistryKey regKey)
+ {
+ return implName.equals(Connector.class.getName())
+ ? FactoryHelper.getServiceFactory(Connector.class, __serviceName,
+ multiFactory, regKey)
+ : null;
+ }
+
+ /**
+ * Constructs a new <code>Connector</code> that uses the given service
+ * factory to create a specific <code>XConnector</code>.
+ *
+ * @param serviceFactory the service factory to use.
+ */
+ public Connector(XMultiServiceFactory serviceFactory) {
+ this.serviceFactory = serviceFactory;
+ }
+
+ /**
+ * Connects via the given connection type to a waiting server.
+ *
+ * <p>The connection description has the following format:
+ * <code><var>type</var></code><!--
+ * -->*(<code><var