documentation

This commit is contained in:
Michael Hönnig
2004-10-28 14:49:01 +00:00
parent c4d92b50a2
commit 28cfd1f82d
4 changed files with 394 additions and 272 deletions

View File

@@ -2,9 +2,9 @@
* *
* $RCSfile: LocalOfficeConnection.java,v $ * $RCSfile: LocalOfficeConnection.java,v $
* *
* $Revision: 1.4 $ * $Revision: 1.5 $
* *
* last change: $Author: mi $ $Date: 2004-10-18 07:15:36 $ * last change: $Author: mi $ $Date: 2004-10-28 15:49:00 $
* *
* The Contents of this file are made available subject to the terms of * The Contents of this file are made available subject to the terms of
* either of the following licenses * either of the following licenses
@@ -106,12 +106,13 @@ public class LocalOfficeConnection
public static final String OFFICE_LIB_NAME = "officebean"; public static final String OFFICE_LIB_NAME = "officebean";
public static final String OFFICE_ID_SUFFIX = "_Office"; public static final String OFFICE_ID_SUFFIX = "_Office";
private static String mProgramPath;
private Process mProcess; private Process mProcess;
private ContainerFactory mContainerFactory; private ContainerFactory mContainerFactory;
private XComponentContext mContext; private XComponentContext mContext;
private String mURL; private String mURL;
private String mProgramPath;
private String mConnType; private String mConnType;
private String mPipe; private String mPipe;
private String mPort; private String mPort;
@@ -120,6 +121,61 @@ public class LocalOfficeConnection
private List mComponents = new Vector(); private List mComponents = new Vector();
//-------------------------------------------------------------------------
static
{
// preload shared libraries whichs import lips are linked to officebean
if ( System.getProperty( "os.name" ).startsWith( "Windows" ) )
{
try
{
NativeLibraryLoader.loadLibrary(LocalOfficeConnection.class.getClassLoader(), "msvcr70");
}
catch (Throwable e)
{
// loading twice would fail
System.err.println( "cannot find msvcr70" );
}
try
{
NativeLibraryLoader.loadLibrary(LocalOfficeConnection.class.getClassLoader(), "msvcr71");
}
catch (Throwable e)
{
// loading twice would fail
System.err.println( "cannot find msvcr71" );
}
try
{
NativeLibraryLoader.loadLibrary(LocalOfficeConnection.class.getClassLoader(), "uwinapi");
}
catch (Throwable e)
{
// loading twice would fail
System.err.println( "cannot find uwinapi" );
}
try
{
NativeLibraryLoader.loadLibrary(LocalOfficeConnection.class.getClassLoader(), "jawt");
}
catch (Throwable e)
{
// loading twice would fail
System.err.println( "cannot find jawt" );
}
}
// load shared library for JNI code
// String aSharedLibName = getProgramPath() + java.io.File.separator +
// System.mapLibraryName(OFFICE_LIB_NAME);
// System.load( aSharedLibName );
NativeLibraryLoader.loadLibrary( LocalOfficeConnection.class.getClassLoader(), "officebean" );
}
//------------------------------------------------------------------------- //-------------------------------------------------------------------------
// debugging method // debugging method
private void dbgPrint( String aMessage ) private void dbgPrint( String aMessage )
@@ -144,11 +200,6 @@ public class LocalOfficeConnection
} }
catch ( java.net.MalformedURLException e ) catch ( java.net.MalformedURLException e )
{} {}
// load libofficebean.so/officebean.dll
String aSharedLibName = getProgramPath() + java.io.File.separator +
System.mapLibraryName(OFFICE_LIB_NAME);
System.load( aSharedLibName );
} }
/** /**
@@ -379,7 +430,7 @@ public class LocalOfficeConnection
* *
* @return The path to the office program folder. * @return The path to the office program folder.
*/ */
private String getProgramPath() static private String getProgramPath()
{ {
if (mProgramPath == null) if (mProgramPath == null)
{ {
@@ -396,7 +447,7 @@ public class LocalOfficeConnection
// find soffice executable relative to this class's class loader: // find soffice executable relative to this class's class loader:
File path = NativeLibraryLoader.getResource( File path = NativeLibraryLoader.getResource(
this.getClass().getClassLoader(), aExec); LocalOfficeConnection.class.getClassLoader(), aExec);
if (path != null) if (path != null)
mProgramPath = path.getParent(); mProgramPath = path.getParent();

View File

@@ -2,9 +2,9 @@
* *
* $RCSfile: OOoBean.java,v $ * $RCSfile: OOoBean.java,v $
* *
* $Revision: 1.5 $ * $Revision: 1.6 $
* *
* last change: $Author: mi $ $Date: 2004-10-14 10:37:13 $ * last change: $Author: mi $ $Date: 2004-10-28 15:49:00 $
* *
* The Contents of this file are made available subject to the terms of * The Contents of this file are made available subject to the terms of
* either of the following licenses * either of the following licenses
@@ -176,21 +176,30 @@ public class OOoBean
} }
//------------------------------------------------------------------------- //-------------------------------------------------------------------------
/// Sets the timeout for methods which launch OOo in milli seconds. /** Sets the timeout for methods which launch OOo in milli seconds.
This method does not need a connection to an OOo instance.
*/
public void setOOoStartTimeOut( int nMilliSecs ) public void setOOoStartTimeOut( int nMilliSecs )
{ {
nOOoStartTimeOut = nMilliSecs; nOOoStartTimeOut = nMilliSecs;
} }
//------------------------------------------------------------------------- //-------------------------------------------------------------------------
/// Sets the timeout for normal OOO methods calls in milli seconds. /** Sets the timeout for normal OOO methods calls in milli seconds.
This method does not need a connection to an OOo instance.
*/
public void setOOoCallTimeOut( int nMilliSecs ) public void setOOoCallTimeOut( int nMilliSecs )
{ {
nOOoCallTimeOut = nMilliSecs; nOOoCallTimeOut = nMilliSecs;
} }
//------------------------------------------------------------------------- //-------------------------------------------------------------------------
/// Sets the period length in milli seconds to check the OOo connection. /** Sets the period length in milli seconds to check the OOo connection.
This method does not need a connection to an OOo instance.
*/
public void setOOoCheckCycle( int nMilliSecs ) public void setOOoCheckCycle( int nMilliSecs )
{ {
nOOoCheckCycle = nMilliSecs; nOOoCheckCycle = nMilliSecs;
@@ -228,6 +237,12 @@ public class OOoBean
//------------------------------------------------------------------------- //-------------------------------------------------------------------------
// @requirement FUNC.CON.STRT/0.4 // @requirement FUNC.CON.STRT/0.4
/** Starts a connection to an OOo instance which is lauched if not running. /** Starts a connection to an OOo instance which is lauched if not running.
@throws HasConnectionException
if a connection was already established.
@throws NoConnectionException
if the specified connection cannot be established
*/ */
public void startOOoConnection( String aConnectionURL ) public void startOOoConnection( String aConnectionURL )
throws java.net.MalformedURLException, throws java.net.MalformedURLException,
@@ -247,20 +262,20 @@ public class OOoBean
*/ */
public boolean isOOoConnected() public boolean isOOoConnected()
{ {
// TBD: could there be an existing, but dead connection?
return iConnection != null; return iConnection != null;
} }
//------------------------------------------------------------------------- //-------------------------------------------------------------------------
// @requirement FUNC.CON.STOP/0.4 // @requirement FUNC.CON.STOP/0.4
/** Disconnects from the connected OOo instance. /** Disconnects from the connected OOo instance.
If there was no connection yet or anymore, this method can be called
anyway.
*/ */
public synchronized void stopOOoConnection() public synchronized void stopOOoConnection()
{ {
// clear OOo document, frame etc. // clear OOo document, frame etc.
try { clear(); } clear();
catch ( java.lang.InterruptedException aExc )
{} // ignore exceptions from an old, dead connection
// cut the connection // cut the connection
OfficeConnection iExConnection = iConnection; OfficeConnection iExConnection = iConnection;
@@ -282,6 +297,9 @@ public class OOoBean
/** Returns the a connection to an OOo instance. /** Returns the a connection to an OOo instance.
If no connection exists, a default connection will be created. If no connection exists, a default connection will be created.
@throws NoConnectionException
if no connection can be established
*/ */
public synchronized OfficeConnection getOOoConnection() public synchronized OfficeConnection getOOoConnection()
throws NoConnectionException throws NoConnectionException
@@ -299,6 +317,11 @@ public class OOoBean
//------------------------------------------------------------------------- //-------------------------------------------------------------------------
/** Returns the service factory used by this OOoBean instance.
@throws NoConnectionException
if no connection is established and no default connection can be established.
*/
public synchronized com.sun.star.lang.XMultiServiceFactory getMultiServiceFactory() public synchronized com.sun.star.lang.XMultiServiceFactory getMultiServiceFactory()
throws NoConnectionException throws NoConnectionException
{ {
@@ -329,7 +352,11 @@ public class OOoBean
} }
//------------------------------------------------------------------------- //-------------------------------------------------------------------------
/// TBD /** Returns the XDesktop interface of the OOo instance used by this OOoBean.
@throws NoConnectionException
if no connection is established and no default connection can be established.
*/
public synchronized com.sun.star.frame.XDesktop getOOoDesktop() public synchronized com.sun.star.frame.XDesktop getOOoDesktop()
throws NoConnectionException throws NoConnectionException
{ {
@@ -356,14 +383,16 @@ public class OOoBean
If a document is loaded and the content modified, If a document is loaded and the content modified,
the changes are dismissed. Otherwise nothing happens. the changes are dismissed. Otherwise nothing happens.
This method works with and without a connection. This method only does only work on specific subclasses.
@param bClearStateToo @param bClearStateToo
Not only the document content but also the state of the bean, Not only the document content but also the state of the bean,
like visibility of child components is cleared. like visibility of child components is cleared.
*/ */
public synchronized void clearDocument( boolean bClearStateToo ) public synchronized void clearDocument( boolean bClearStateToo )
throws com.sun.star.util.CloseVetoException throws
com.sun.star.util.CloseVetoException,
NoConnectionException
{ {
// TBD // TBD
com.sun.star.util.XCloseable xCloseable = (com.sun.star.util.XCloseable) com.sun.star.util.XCloseable xCloseable = (com.sun.star.util.XCloseable)
@@ -380,12 +409,15 @@ public class OOoBean
Any loaded document is unloaded, no matter whether it is modified or not. Any loaded document is unloaded, no matter whether it is modified or not.
After calling this method, the OOoBean has no office document and no frame After calling this method, the OOoBean has no office document and no frame
anymore. The connection will stay, though. anymore. The connection will stay, though.
This method works with or without an established connection.
*/ */
public synchronized void clear() public synchronized void clear()
throws java.lang.InterruptedException
{ {
dbgPrint( "clear()" ); dbgPrint( "clear()" );
try
{
CallWatchThread aCallWatchThread = CallWatchThread aCallWatchThread =
new CallWatchThread( nOOoCallTimeOut, "clear" ); new CallWatchThread( nOOoCallTimeOut, "clear" );
aDocument = null; aDocument = null;
@@ -425,6 +457,9 @@ public class OOoBean
aCallWatchThread.cancel(); aCallWatchThread.cancel();
} }
catch ( java.lang.InterruptedException aExc )
{ /* can be ignored */ }
}
//------------------------------------------------------------------------- //-------------------------------------------------------------------------
// @requirement FUNC.PAR.LWP/0.4 // @requirement FUNC.PAR.LWP/0.4
@@ -502,29 +537,29 @@ public class OOoBean
If no connection exists, a default connection is established. If no connection exists, a default connection is established.
@throws java.io.IOException
if an IO error occurs reading the ressource specified by the URL.
@throws IllegalArgumentException @throws IllegalArgumentException
if either of the arguments is out of the specified range. if either of the arguments is out of the specified range.
@throws NoConnectionException @throws java.io.IOException
if an IO error occurs reading the ressource specified by the URL.
@throws com.sun.star.lang.NoConnectionException
if no connection can be established. if no connection can be established.
*/ */
public void loadFromURL( public void loadFromURL(
final String aURL, final String aURL,
final com.sun.star.beans.PropertyValue aArguments[] ) final com.sun.star.beans.PropertyValue aArguments[] )
throws throws
java.io.IOException,
java.lang.InterruptedException,
com.sun.star.lang.IllegalArgumentException,
// @requirement FUNC.CON.LOST/0.2 // @requirement FUNC.CON.LOST/0.2
NoConnectionException NoConnectionException,
java.io.IOException,
com.sun.star.lang.IllegalArgumentException
{ {
dbgPrint( "loadFromURL()" ); dbgPrint( "loadFromURL()" );
// try loading // try loading
try
{
boolean bLoaded = false; boolean bLoaded = false;
while ( !bLoaded ) while ( !bLoaded )
{ {
@@ -657,7 +692,6 @@ public class OOoBean
if ( xServiceFactory == null ) if ( xServiceFactory == null )
throw new NoConnectionException(); throw new NoConnectionException();
} }
if ( iConnection == null ) if ( iConnection == null )
{ {
throw new NoConnectionException(); throw new NoConnectionException();
@@ -665,6 +699,11 @@ public class OOoBean
applyToolVisibilities(); applyToolVisibilities();
} }
catch ( java.lang.InterruptedException aExc )
{
throw new NoConnectionException();
}
}
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
/** Loads a document from a Java stream. /** Loads a document from a Java stream.
@@ -675,13 +714,10 @@ public class OOoBean
final java.io.InputStream iInStream, final java.io.InputStream iInStream,
final com.sun.star.beans.PropertyValue aArguments[] ) final com.sun.star.beans.PropertyValue aArguments[] )
throws throws
java.io.IOException,
java.lang.InterruptedException,
com.sun.star.lang.IllegalArgumentException,
// @requirement FUNC.CON.LOST/0.2 // @requirement FUNC.CON.LOST/0.2
NoConnectionException NoConnectionException,
java.io.IOException,
com.sun.star.lang.IllegalArgumentException
{ {
// wrap Java stream into UNO stream // wrap Java stream into UNO stream
/* /*
@@ -717,7 +753,7 @@ public class OOoBean
"InputStream", -1, xStream, com.sun.star.beans.PropertyState.DIRECT_VALUE ) ); "InputStream", -1, xStream, com.sun.star.beans.PropertyState.DIRECT_VALUE ) );
// call normal load method // call normal load method
loadFromURL( "private:stream/", aExtendedArguments ); loadFromURL( "private:stream", aExtendedArguments );
} }
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
@@ -729,13 +765,10 @@ public class OOoBean
final byte aInBuffer[], final byte aInBuffer[],
final com.sun.star.beans.PropertyValue aArguments[] ) final com.sun.star.beans.PropertyValue aArguments[] )
throws throws
java.io.IOException,
java.lang.InterruptedException,
com.sun.star.lang.IllegalArgumentException,
// @requirement FUNC.CON.LOST/0.2 // @requirement FUNC.CON.LOST/0.2
NoConnectionException NoConnectionException,
java.io.IOException,
com.sun.star.lang.IllegalArgumentException
{ {
// wrap byte arrray into UNO stream // wrap byte arrray into UNO stream
com.sun.star.io.XInputStream xStream = com.sun.star.io.XInputStream xStream =
@@ -748,24 +781,39 @@ public class OOoBean
"InputStream", -1, xStream, com.sun.star.beans.PropertyState.DIRECT_VALUE ) ); "InputStream", -1, xStream, com.sun.star.beans.PropertyState.DIRECT_VALUE ) );
// call normal load method // call normal load method
loadFromURL( "private:stream/", aExtendedArguments ); loadFromURL( "private:stream", aExtendedArguments );
} }
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
/** Stores a document to a URL. /** Stores a document to the given URL.
*
* TBD @throws IllegalArgumentException
if either of the arguments is out of the specified range.
@throws java.io.IOException
if an IO error occurs reading the ressource specified by the URL.
@throws com.sun.star.lang.NoConnectionException
if no connection is established.
@throws NoDocumentException
if no document is loaded
*/ */
public void storeToURL( public void storeToURL(
final String aURL, final String aURL,
final com.sun.star.beans.PropertyValue aArguments[] ) final com.sun.star.beans.PropertyValue aArguments[] )
throws throws
java.io.IOException,
java.lang.InterruptedException,
com.sun.star.lang.IllegalArgumentException,
// @requirement FUNC.CON.LOST/0.2 // @requirement FUNC.CON.LOST/0.2
NoConnectionException NoConnectionException,
java.io.IOException,
com.sun.star.lang.IllegalArgumentException,
NoDocumentException
{
// no document available?
if ( aDocument == null )
throw new NoDocumentException();
try
{ {
// start runtime timeout // start runtime timeout
CallWatchThread aCallWatchThread = CallWatchThread aCallWatchThread =
@@ -779,6 +827,9 @@ public class OOoBean
// end runtime timeout // end runtime timeout
aCallWatchThread.cancel(); aCallWatchThread.cancel();
} }
catch ( java.lang.InterruptedException aExc )
{ throw new NoConnectionException(); }
}
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
/** Stores a document to a stream. /** Stores a document to a stream.
@@ -789,12 +840,11 @@ public class OOoBean
java.io.OutputStream aOutStream, java.io.OutputStream aOutStream,
final com.sun.star.beans.PropertyValue aArguments[] ) final com.sun.star.beans.PropertyValue aArguments[] )
throws throws
java.io.IOException,
java.lang.InterruptedException,
com.sun.star.lang.IllegalArgumentException,
// @requirement FUNC.CON.LOST/0.2 // @requirement FUNC.CON.LOST/0.2
NoConnectionException NoConnectionException,
NoDocumentException,
java.io.IOException,
com.sun.star.lang.IllegalArgumentException
{ {
// wrap Java stream into UNO stream // wrap Java stream into UNO stream
@@ -808,7 +858,7 @@ public class OOoBean
"OutputStream", -1, aStream, com.sun.star.beans.PropertyState.DIRECT_VALUE ) ); "OutputStream", -1, aStream, com.sun.star.beans.PropertyState.DIRECT_VALUE ) );
// call normal store method // call normal store method
storeToURL( "private:stream/", aExtendedArguments ); storeToURL( "private:stream", aExtendedArguments );
// get byte array from document stream // get byte array from document stream
try { aStream.closeOutput(); } try { aStream.closeOutput(); }
@@ -830,13 +880,11 @@ public class OOoBean
byte aOutBuffer[], byte aOutBuffer[],
final com.sun.star.beans.PropertyValue aArguments[] ) final com.sun.star.beans.PropertyValue aArguments[] )
throws throws
java.io.IOException,
java.lang.InterruptedException,
com.sun.star.lang.IllegalArgumentException,
// @requirement FUNC.CON.LOST/0.2 // @requirement FUNC.CON.LOST/0.2
NoConnectionException NoConnectionException,
NoDocumentException,
java.io.IOException,
com.sun.star.lang.IllegalArgumentException
{ {
// wrap byte arrray into UNO stream // wrap byte arrray into UNO stream
com.sun.star.lib.uno.adapter.XOutputStreamToByteArrayAdapter aStream = com.sun.star.lib.uno.adapter.XOutputStreamToByteArrayAdapter aStream =
@@ -849,7 +897,7 @@ public class OOoBean
"OutputStream", -1, aStream, com.sun.star.beans.PropertyState.DIRECT_VALUE ) ); "OutputStream", -1, aStream, com.sun.star.beans.PropertyState.DIRECT_VALUE ) );
// call normal store method // call normal store method
storeToURL( "private:stream/", aExtendedArguments ); storeToURL( "private:stream", aExtendedArguments );
// get byte array from document stream // get byte array from document stream
try { aStream.closeOutput(); } try { aStream.closeOutput(); }
@@ -877,11 +925,14 @@ public class OOoBean
@throws NoConnectionException @throws NoConnectionException
if the connection is not established. if the connection is not established.
@throws NotDocumentException
if no document is loaded an thus no frame is available.
*/ */
public Frame getFrame() public Frame getFrame()
// @requirement FUNC.CON.LOST/0.2 throws
throws NoConnectionException NoConnectionException // @requirement FUNC.CON.LOST/0.2
{ {
if ( iConnection == null ) if ( iConnection == null )
throw new NoConnectionException(); throw new NoConnectionException();
@@ -902,17 +953,11 @@ public class OOoBean
@throws NoConnectionException @throws NoConnectionException
if the connection is not established. if the connection is not established.
@throws NotDocumentLoadedException
if no document is loaded an thus no controller is available.
*/ */
public Controller getController() public Controller getController()
// @requirement FUNC.CON.LOST/0.2 // @requirement FUNC.CON.LOST/0.2
throws NoConnectionException, throws NoConnectionException
// @requirement API.NODC
NoDocumentException
{ {
if ( iConnection == null ) if ( iConnection == null )
throw new NoConnectionException(); throw new NoConnectionException();
@@ -939,17 +984,11 @@ public class OOoBean
@throws NoConnectionException @throws NoConnectionException
if the connection is not established. if the connection is not established.
@throws NotDocumentLoadedException
if no document is loaded.
*/ */
public OfficeDocument getDocument() public OfficeDocument getDocument()
// @requirement FUNC.CON.LOST/0.2 // @requirement FUNC.CON.LOST/0.2
throws NoConnectionException, throws NoConnectionException
// @requirement API.NODC
NoDocumentException // TBD
{ {
if ( iConnection == null ) if ( iConnection == null )
throw new NoConnectionException(); throw new NoConnectionException();
@@ -966,10 +1005,12 @@ public class OOoBean
If an older OOoBean instance is used with a newer OOo instance, If an older OOoBean instance is used with a newer OOo instance,
some tool bars might not be affected by this method. some tool bars might not be affected by this method.
If no connection is established or no document is loaded,
the setting is memorized until a document is loaded. Same
is valid when the connection dies within this function call.
*/ */
public void setAllBarsVisible( boolean bVisible ) public void setAllBarsVisible( boolean bVisible )
throws
java.lang.InterruptedException
{ {
bIgnoreVisibility = true; bIgnoreVisibility = true;
setMenuBarVisible( bVisible ); setMenuBarVisible( bVisible );
@@ -1057,23 +1098,29 @@ public class OOoBean
If not connected or no document loaded, the value is stored If not connected or no document loaded, the value is stored
and automatically applied to the document after it is loaded. and automatically applied to the document after it is loaded.
Same is valid when the connection dies within this function call.
@param bVisible @param bVisible
If false, the menu bar is disabled, If false, the menu bar is disabled,
If true, the menu bar is visible. If true, the menu bar is visible.
*/ */
public void setMenuBarVisible(boolean bVisible) public void setMenuBarVisible(boolean bVisible)
throws {
java.lang.InterruptedException try
{ {
bMenuBarVisible = setToolVisible( "MenuBarVisible", "private:resource/menubar/menubar", bMenuBarVisible = setToolVisible( "MenuBarVisible", "private:resource/menubar/menubar",
SID_TOGGLEMENUBAR, "MenuBarVisible", bMenuBarVisible, bVisible ); SID_TOGGLEMENUBAR, "MenuBarVisible", bMenuBarVisible, bVisible );
} }
catch ( java.lang.InterruptedException aExc )
{ bMenuBarVisible = bVisible; }
}
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
/* Returns the visibility of the menu bar. /* Returns the visibility of the menu bar.
This method works independently from a connetion or loaded document. This method works independently from a connetion or loaded document.
If no connection is established or no document is loaded,
this method just returns a memorized status.
@return @return
True if the menu bar is visible, True if the menu bar is visible,
@@ -1091,23 +1138,29 @@ public class OOoBean
If not connected or no document loaded, the value is stored If not connected or no document loaded, the value is stored
and automatically applied to the document after it is loaded. and automatically applied to the document after it is loaded.
Same is valid when the connection dies within this function call.
@param bVisible @param bVisible
If false, the main function bar is disabled, If false, the main function bar is disabled,
If true, the main function bar is visible. If true, the main function bar is visible.
*/ */
public void setStandardBarVisible(boolean bVisible) public void setStandardBarVisible(boolean bVisible)
throws {
java.lang.InterruptedException try
{ {
bStandardBarVisible = setToolVisible( "StandardBarVisible", "private:resource/toolbar/standardbar", bStandardBarVisible = setToolVisible( "StandardBarVisible", "private:resource/toolbar/standardbar",
SID_TOGGLEMAINBAR, "FunctionBarVisible", bStandardBarVisible, bVisible ); SID_TOGGLEMAINBAR, "FunctionBarVisible", bStandardBarVisible, bVisible );
} }
catch ( java.lang.InterruptedException aExc )
{ bMenuBarVisible = bVisible; }
}
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
/* Returns the visibility of the main function bar. /* Returns the visibility of the main function bar.
This method works independently from a connetion or loaded document. This method works independently from a connetion or loaded document.
If no connection is established or no document is loaded,
this method just returns a memorized status.
@return @return
True if the main function bar is visible, True if the main function bar is visible,
@@ -1125,23 +1178,29 @@ public class OOoBean
If not connected or no document loaded, the value is stored If not connected or no document loaded, the value is stored
and automatically applied to the document after it is loaded. and automatically applied to the document after it is loaded.
Same is valid when the connection dies within this function call.
@param bVisible @param bVisible
If false, the tool function bar is disabled, If false, the tool function bar is disabled,
If true, the tool function bar is visible. If true, the tool function bar is visible.
*/ */
public void setToolBarVisible(boolean bVisible) public void setToolBarVisible(boolean bVisible)
throws {
java.lang.InterruptedException try
{ {
bToolBarVisible = setToolVisible( "ToolBarVisible", "private:resource/toolbar/toolbar", bToolBarVisible = setToolVisible( "ToolBarVisible", "private:resource/toolbar/toolbar",
SID_TOGGLETOOLBAR, "ToolBarVisible", bToolBarVisible, bVisible ); SID_TOGGLETOOLBAR, "ToolBarVisible", bToolBarVisible, bVisible );
} }
catch ( java.lang.InterruptedException aExc )
{ bMenuBarVisible = bVisible; }
}
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
/* Returns the visibility of the tool function bar. /* Returns the visibility of the tool function bar.
This method works independently from a connetion or loaded document. This method works independently from a connetion or loaded document.
If no connection is established or no document is loaded,
this method just returns a memorized status.
@return @return
True if the tool function bar is visible, True if the tool function bar is visible,
@@ -1159,23 +1218,29 @@ public class OOoBean
If not connected or no document loaded, the value is stored If not connected or no document loaded, the value is stored
and automatically applied to the document after it is loaded. and automatically applied to the document after it is loaded.
Same is valid when the connection dies within this function call.
@param bVisible @param bVisible
If false, the status function bar is disabled, If false, the status function bar is disabled,
If true, the status function bar is visible. If true, the status function bar is visible.
*/ */
public void setStatusBarVisible(boolean bVisible) public void setStatusBarVisible(boolean bVisible)
throws {
java.lang.InterruptedException try
{ {
bStatusBarVisible = setToolVisible( "StatusBarVisible", "private:resource/statusbar/statusbar", bStatusBarVisible = setToolVisible( "StatusBarVisible", "private:resource/statusbar/statusbar",
SID_TOGGLESTATUSBAR, "StatusBarVisible", bStatusBarVisible, bVisible ); SID_TOGGLESTATUSBAR, "StatusBarVisible", bStatusBarVisible, bVisible );
} }
catch ( java.lang.InterruptedException aExc )
{ bMenuBarVisible = bVisible; }
}
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
/* Returns the visibility of the status function bar. /* Returns the visibility of the status function bar.
This method works independently from a connetion or loaded document. This method works independently from a connetion or loaded document.
If no connection is established or no document is loaded,
this method just returns a memorized status.
@return @return
True if the status function bar is visible, True if the status function bar is visible,

View File

@@ -2,9 +2,9 @@
* *
* $RCSfile: com_sun_star_beans_LocalOfficeWindow.c,v $ * $RCSfile: com_sun_star_beans_LocalOfficeWindow.c,v $
* *
* $Revision: 1.1 $ * $Revision: 1.2 $
* *
* last change: $Author: mi $ $Date: 2004-10-18 07:16:18 $ * last change: $Author: mi $ $Date: 2004-10-28 15:49:01 $
* *
* The Contents of this file are made available subject to the terms of * The Contents of this file are made available subject to the terms of
* either of the following licenses * either of the following licenses
@@ -86,6 +86,9 @@
#define SYSTEM_MAC 5 #define SYSTEM_MAC 5
#define SYSTEM_XWINDOW 6 #define SYSTEM_XWINDOW 6
JNIEXPORT jlong JNICALL Java_com_sun_star_comp_beans_LocalOfficeWindow_getNativeWindow
(JNIEnv * env, jobject obj_this);
/*****************************************************************************/ /*****************************************************************************/
/* /*
* Class: com_sun_star_comp_beans_LocalOfficeWindow * Class: com_sun_star_comp_beans_LocalOfficeWindow

View File

@@ -2,9 +2,9 @@
* *
* $RCSfile: com_sun_star_beans_LocalOfficeWindow.c,v $ * $RCSfile: com_sun_star_beans_LocalOfficeWindow.c,v $
* *
* $Revision: 1.1 $ * $Revision: 1.2 $
* *
* last change: $Author: mi $ $Date: 2004-10-18 07:16:33 $ * last change: $Author: mi $ $Date: 2004-10-28 15:49:01 $
* *
* The Contents of this file are made available subject to the terms of * The Contents of this file are made available subject to the terms of
* either of the following licenses * either of the following licenses
@@ -86,6 +86,9 @@
static LRESULT APIENTRY OpenOfficeWndProc( HWND , UINT , WPARAM , LPARAM ); static LRESULT APIENTRY OpenOfficeWndProc( HWND , UINT , WPARAM , LPARAM );
JNIEXPORT jlong JNICALL Java_com_sun_star_comp_beans_LocalOfficeWindow_getNativeWindow
(JNIEnv * env, jobject obj_this);
/*****************************************************************************/ /*****************************************************************************/
/* /*
* Class: com_sun_star_beans_LocalOfficeWindow * Class: com_sun_star_beans_LocalOfficeWindow