diff --git a/bean/Jar_officebean.mk b/bean/Jar_officebean.mk index 852788318cd5..12b895aa191b 100644 --- a/bean/Jar_officebean.mk +++ b/bean/Jar_officebean.mk @@ -20,14 +20,6 @@ $(eval $(call gb_Jar_use_jars,officebean,\ $(eval $(call gb_Jar_set_packageroot,officebean,com)) $(eval $(call gb_Jar_add_sourcefiles,officebean,\ - bean/com/sun/star/beans/ContainerFactory \ - bean/com/sun/star/beans/JavaWindowPeerFake \ - bean/com/sun/star/beans/LocalOfficeConnection \ - bean/com/sun/star/beans/LocalOfficeWindow \ - bean/com/sun/star/beans/NativeConnection \ - bean/com/sun/star/beans/NativeService \ - bean/com/sun/star/beans/OfficeConnection \ - bean/com/sun/star/beans/OfficeWindow \ bean/com/sun/star/comp/beans/ContainerFactory \ bean/com/sun/star/comp/beans/Controller \ bean/com/sun/star/comp/beans/Frame \ diff --git a/bean/com/sun/star/beans/ContainerFactory.java b/bean/com/sun/star/beans/ContainerFactory.java deleted file mode 100644 index e3c0c9d9d7e2..000000000000 --- a/bean/com/sun/star/beans/ContainerFactory.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * 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.beans; - -import java.awt.Container; - -/** - * This interface reprecents an AWT container factory. - * - * @see OfficeBean - * @deprecated - */ - -public interface ContainerFactory -{ - /** - * Creates an AWT container. - * - * @return An AWT container. - */ - Container createContainer(); -} diff --git a/bean/com/sun/star/beans/JavaWindowPeerFake.java b/bean/com/sun/star/beans/JavaWindowPeerFake.java deleted file mode 100644 index efd57d02bd71..000000000000 --- a/bean/com/sun/star/beans/JavaWindowPeerFake.java +++ /dev/null @@ -1,113 +0,0 @@ -/* - * 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.beans; - -import com.sun.star.awt.*; - -/**
Class to pass the system window handle to the OpenOffice.org toolkit.
- * @deprecated - */ -/* package */ class JavaWindowPeerFake - implements XSystemDependentWindowPeer, XWindowPeer -{ - - private long hWindow; - private int localSystemType; - - /** Create the faked window peer. - * @param _hWindow the system handle to the window. - * @param _systemType specifies the system type. - */ - public JavaWindowPeerFake(long _hWindow, int _systemType) - { - hWindow = _hWindow; - localSystemType = _systemType; - } - - /**Implementation of XSystemDependentWindowPeer (that's all we really need)
- * This method is called back from the OpenOffice.org toolkit to retrieve the system data. - */ - public Object getWindowHandle(/*IN*/byte[] ProcessId, /*IN*/short SystemType) - throws com.sun.star.uno.RuntimeException - { - - if (SystemType == localSystemType) { - return Integer.valueOf((int)hWindow); - } - else return null; - } - - /** not really neaded. - */ - public XToolkit getToolkit() - throws com.sun.star.uno.RuntimeException - { - return null; - } - - /** not really neaded. - */ - public void setPointer(/*IN*/XPointer Pointer) - throws com.sun.star.uno.RuntimeException - { - } - - /** not really neaded. - */ - public void setBackground(/*IN*/int Color) - throws com.sun.star.uno.RuntimeException - { - } - - /** not really neaded. - */ - public void invalidate(/*IN*/short Flags) - throws com.sun.star.uno.RuntimeException - { - } - - /** not really neaded. - */ - public void invalidateRect(/*IN*/com.sun.star.awt.Rectangle Rect, /*IN*/short Flags) - throws com.sun.star.uno.RuntimeException - { - } - - /** not really neaded. - */ - public void dispose() - throws com.sun.star.uno.RuntimeException - { - } - - /** not really neaded. - */ - public void addEventListener(/*IN*/com.sun.star.lang.XEventListener xListener) - throws com.sun.star.uno.RuntimeException - { - } - - /** not really neaded. - */ - public void removeEventListener(/*IN*/com.sun.star.lang.XEventListener aListener) - throws com.sun.star.uno.RuntimeException - { - } -} - diff --git a/bean/com/sun/star/beans/LocalOfficeConnection.java b/bean/com/sun/star/beans/LocalOfficeConnection.java deleted file mode 100644 index a47650de6550..000000000000 --- a/bean/com/sun/star/beans/LocalOfficeConnection.java +++ /dev/null @@ -1,611 +0,0 @@ -/* - * 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.beans; - -import java.awt.Container; -import java.io.File; -import java.io.UnsupportedEncodingException; -import java.util.Iterator; -import java.util.List; -import java.util.ArrayList; -import java.util.Arrays; - -import com.sun.star.lang.XMultiComponentFactory; -import com.sun.star.lang.XEventListener; -import com.sun.star.bridge.XUnoUrlResolver; -import com.sun.star.uno.XComponentContext; -import com.sun.star.uno.UnoRuntime; -import com.sun.star.lib.uno.helper.UnoUrl; -import com.sun.star.lib.util.NativeLibraryLoader; - -/** - * This class represents a connection to the local office application. - * @deprecated - */ -public class LocalOfficeConnection - implements OfficeConnection -{ - public static final String OFFICE_APP_NAME = "soffice"; - public static final String OFFICE_LIB_NAME = "officebean"; - public static final String OFFICE_ID_SUFFIX = "_Office"; - - private Process mProcess; - private XComponentContext mContext; - - private String mURL; - private String mProgramPath; - private String mConnType; - private String mPipe; - private String mPort; - private String mProtocol; - private String mInitialObject; - - private ListOFFICE_PROP_FILE
in the user
- * home directory.- * url := uno:localoffice[,<params>];urp;StarOffice.ServiceManager - * params := <path>[,<pipe>] - * path := path=<pathv> - * pipe := pipe=<pipev> - * pathv := platform_specific_path_to_the_local_office_distribution - * pipev := local_office_connection_pipe_name - *- * - * @param url This is UNO URL which describes the type of a connection. - */ - public void setUnoUrl(String url) - throws java.net.MalformedURLException - { - mURL = null; - - String prefix = "uno:localoffice"; - if ( url.startsWith(prefix) ) - parseUnoUrlWithOfficePath( url, prefix ); - else - { - try - { - UnoUrl aURL = UnoUrl.parseUnoUrl( url ); - mProgramPath = null; - mConnType = aURL.getConnection(); - mPipe = aURL.getConnectionParameters().get( "pipe" ); - mPort = aURL.getConnectionParameters().get( "port" ); - mProtocol = aURL.getProtocol(); - mInitialObject = aURL.getRootOid(); - } - catch ( com.sun.star.lang.IllegalArgumentException eIll ) - { - throw new java.net.MalformedURLException( - "Invalid UNO connection URL."); - } - } - mURL = url; - } - - /** - * Sets an AWT container factory. - * - * @param containerFactory This is a application provided AWT container - * factory. - */ - public void setContainerFactory(ContainerFactory containerFactory) - { - } - - /** - * Retrieves the UNO component context. - * Establishes a connection if necessary and initialises the - * UNO service manager if it has not already been initialised. - * This method can return
null
if it fails to connect
- * to the office application.
- *
- * @return The office UNO component context.
- */
- public XComponentContext getComponentContext()
- {
- if ( mContext == null )
- mContext = connect();
- return mContext;
- }
-
- /**
- * Creates an office window.
- * The window is either a sub-class of java.awt.Canvas (local) or
- * java.awt.Container (RVP).
- *
- * @param container This is an AWT container.
- * @return The office window instance.
- */
- public OfficeWindow createOfficeWindow(Container container)
- {
- return new LocalOfficeWindow(this);
- }
-
- /**
- * Closes the connection.
- */
- public void dispose()
- {
- Iterator- * url := uno:localoffice[,<params>];urp;StarOffice.NamingService - * params := <path>[,<pipe>] - * path := path=<pathv> - * pipe := pipe=<pipev> - * pathv := platform_specific_path_to_the_local_office_distribution - * pipev := local_office_connection_pipe_name - *- * - *
null
.
- *
- * @source The event object.
- */
- public void disposing(EventObject source)
- {
- // the window will be disposed by the framework
- mWindow = null;
- mConnection = null;
- }
-
- /**
- * Returns an AWT toolkit.
- */
- private XToolkit queryAWTToolkit()
- throws com.sun.star.uno.Exception
- {
- // Create a UNO toolkit.
- XMultiComponentFactory compfactory;
- XComponentContext xContext = mConnection.getComponentContext();
- if ( xContext != null )
- {
- compfactory = mConnection.getComponentContext().getServiceManager();
- XMultiServiceFactory factory;
- factory = UnoRuntime.queryInterface(
- XMultiServiceFactory.class, compfactory);
- Object object = factory.createInstance( "com.sun.star.awt.Toolkit");
- return UnoRuntime.queryInterface(XToolkit.class, object);
- }
- else
- return null;
- }
-
- /// called when system parent is available, reparents the bean window
- private void aquireSystemWindow()
- {
- if ( !bPeer )
- {
- // set real parent
- XVclWindowPeer xVclWindowPeer = UnoRuntime.queryInterface(
- XVclWindowPeer.class, mWindow);
- xVclWindowPeer.setProperty( "PluginParent", Long.valueOf(getNativeWindow()) );
- bPeer = true;
-
- // show document window
- XWindow aWindow = UnoRuntime.queryInterface(XWindow.class, mWindow);
- aWindow.setVisible( true );
- }
- }
-
- /// called when system parent is about to die, reparents the bean window
- private void releaseSystemWindow()
- {
- if ( bPeer )
- {
- // hide document window
- XWindow aWindow = UnoRuntime.queryInterface(XWindow.class, mWindow);
- aWindow.setVisible( false );
-
- // set null parent
- XVclWindowPeer xVclWindowPeer = UnoRuntime.queryInterface(
- XVclWindowPeer.class, mWindow);
- xVclWindowPeer.setProperty( "PluginParent", Long.valueOf(0) );
- bPeer = false;
- }
- }
-
- /// callback handler to get to know when we become visible
- //@deprecated
- private class ComponentEventHandler
- extends java.awt.event.ComponentAdapter
- {
- @Override
- public void componentHidden( java.awt.event.ComponentEvent e)
- {
- // only when we become invisible, we might lose our system window
- CallWatchThread aCallWatchThread = new CallWatchThread( 500 );
- setVisible(false);
- try { aCallWatchThread.cancel(); }
- catch ( InterruptedException aExc )
- {} // ignore
- }
-
- @Override
- public void componentShown( java.awt.event.ComponentEvent e)
- {
- // only when we become visible, we get a system window
- aquireSystemWindow();
- }
- }
-
- /// Overriding java.awt.Component.setVisible() due to Java bug (no showing event).
- @Override
- public void setVisible( boolean b )
- {
- super.setVisible(b);
-
- // Java-Bug: componentShown() is never called :-(
- // is still at least in Java 1.4.1_02
- if ( b )
- aquireSystemWindow();
- else
- releaseSystemWindow();
- }
-
- /** Factory method for a UNO AWT toolkit window as a child of this Java window.
- *
- */
- private XWindowPeer createUNOWindowPeer()
- {
- try
- {
- // get this windows native window type
- int type = getNativeWindowSystemType();
-
- // Java AWT windows only have a system window when showing.
- XWindowPeer parentPeer;
- if ( isShowing() )
- {
- // create direct parent relationship
- parentPeer = new JavaWindowPeerFake( getNativeWindow(), type);
- bPeer = true;
- }
- else
- {
- // no parent yet
- parentPeer = null;
- bPeer = false;
- }
-
- // create native window (mWindow)
- Rectangle aRect = new Rectangle( 0, 0, 20, 20 );
- WindowDescriptor desc = new WindowDescriptor();
- desc.Type = WindowClass.TOP;
- desc.Parent = parentPeer;
- desc.Bounds = aRect;
- desc.WindowServiceName = "workwindow";
- desc.WindowAttributes = (type == SystemDependent.SYSTEM_WIN32)
- ? WindowAttribute.SHOW : 0;
- mWindow = queryAWTToolkit().createWindow(desc);
-
- // to get notified when we become visible
- addComponentListener( new ComponentEventHandler() );
-
- // set initial visibility
- XWindow aWindow = UnoRuntime.queryInterface(XWindow.class, mWindow);
- aWindow.setVisible( bPeer );
- }
- catch (com.sun.star.uno.Exception exp) {
- }
-
- return mWindow;
- }
-
- /**
- * Retrieves a platform dependent system window identifier.
- *
- * @return The system window identifier.
- */
- private native long getNativeWindow();
-
- /**
- * Retrieves a platform dependent system window type.
- *
- * @return The system window type.
- */
- private native int getNativeWindowSystemType();
-
-
- /** Helper class to watch calls into OOo with a timeout.
- * @deprecated
- */
- private class CallWatchThread extends Thread
- {
- private Thread aWatchedThread;
- private long nTimeout;
-
- private CallWatchThread( long nTimeout )
- {
- super("CallWatchThread deprecated");
-
- this.aWatchedThread = Thread.currentThread();
- this.nTimeout = nTimeout;
- start();
- }
-
- private void cancel()
- throws InterruptedException
- {
- aWatchedThread = null;
- stop();
-
- if ( Thread.interrupted() )
- throw new InterruptedException();
- }
-
- @Override
- public void run()
- {
- while ( aWatchedThread != null )
- {
- try { sleep( nTimeout ); }
- catch ( InterruptedException aExc )
- {}
-
- //synchronized
- {
- if ( aWatchedThread != null )
- {
- aWatchedThread.interrupt();
- }
- }
- }
- }
- }
-
-}
diff --git a/bean/com/sun/star/beans/NativeConnection.java b/bean/com/sun/star/beans/NativeConnection.java
deleted file mode 100644
index 7147235fc668..000000000000
--- a/bean/com/sun/star/beans/NativeConnection.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * 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.beans;
-
-import com.sun.star.connection.XConnection;
-/* @deprecated
- */
-/* package */ class NativeConnection
- implements XConnection
-{
- public native void connect(NativeService aNativeService)
- throws com.sun.star.io.IOException;
-
- public native int read(/*OUT*/byte[][] aReadBytes, /*IN*/int nBytesToRead)
- throws com.sun.star.io.IOException, com.sun.star.uno.RuntimeException;
-
- public native void write(/*IN*/byte[] aData)
- throws com.sun.star.io.IOException, com.sun.star.uno.RuntimeException;
-
- public native void flush()
- throws com.sun.star.io.IOException, com.sun.star.uno.RuntimeException;
-
- public native void close()
- throws com.sun.star.io.IOException, com.sun.star.uno.RuntimeException;
-
- public synchronized String getDescription()
- throws com.sun.star.uno.RuntimeException
- {
- return Description;
- }
-
- private long NativeHandle;
- private String Description;
-}
diff --git a/bean/com/sun/star/beans/NativeService.java b/bean/com/sun/star/beans/NativeService.java
deleted file mode 100644
index 9e06e798dcbc..000000000000
--- a/bean/com/sun/star/beans/NativeService.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * 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.beans;
-
-/* @deprecated
- */
-/* package */ interface NativeService {
- String getIdentifier();
- void startupService() throws java.io.IOException;
- int getStartupTime();
-}
diff --git a/bean/com/sun/star/beans/OfficeConnection.java b/bean/com/sun/star/beans/OfficeConnection.java
deleted file mode 100644
index 911fae52f02f..000000000000
--- a/bean/com/sun/star/beans/OfficeConnection.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * 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.beans;
-
-import com.sun.star.lang.XComponent;
-import com.sun.star.uno.XComponentContext;
-import java.awt.Container;
-
-/**
- * This abstract class reprecents a connection to the office
- * application.
- * @deprecated
- */
-public interface OfficeConnection
- extends XComponent
-{
- /**
- * Sets a connection URL.
- *
- * @param url This is UNO URL which describes the type of a connection.
- */
- void setUnoUrl(String url)
- throws java.net.MalformedURLException;
-
- /**
- * Sets an AWT container catory.
- *
- * @param containerFactory This is a application provided AWT container
- * factory.
- */
- void setContainerFactory(ContainerFactory containerFactory);
-
- /**
- * Retrieves the UNO component context.
- * Establishes a connection if necessary and initialises the
- * UNO service manager if it has not already been initialised.
- *
- * @return The office UNO component context.
- */
- XComponentContext getComponentContext();
-
- /**
- * Creates an office window.
- * The window is either a sub-class of java.awt.Canvas (local) or
- * java.awt.Container (RVP).
- *
- * This method does not add add the office window to its container.
- *
- * @param container This is an AWT container.
- * @return The office window instance.
- */
- OfficeWindow createOfficeWindow(Container container);
-}
diff --git a/bean/com/sun/star/beans/OfficeWindow.java b/bean/com/sun/star/beans/OfficeWindow.java
deleted file mode 100644
index ebc46b8335de..000000000000
--- a/bean/com/sun/star/beans/OfficeWindow.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * 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.beans;
-
-import java.awt.Component;
-
-import com.sun.star.awt.XWindowPeer;
-
-/**
- * The concreate implementation of the OfficeWindow extends an
- * approperate type of visual component (java.awt.Canvas for local
- * and java.awt.Container for remote).
- * @deprecated
- */
-public interface OfficeWindow
-{
- /**
- * Retrieves an AWT component object associated with the OfficeWindow.
- *
- * @return The AWT component object associated with the OfficeWindow.
- */
- Component getAWTComponent();
-
- /**
- * Retrieves an UNO XWindowPeer object associated with the OfficeWindow.
- *
- * @return The UNO XWindowPeer object associated with the OfficeWindow.
- */
- XWindowPeer getUNOWindowPeer();
-}