Hi Daniel,
not being a Python user at all, I suggest to explicitly query
("queryInterface") for the "com.sun.star.presentation.XPresentation2"
interface. This interface should than provide you a "getController"
method ...
Regards
Kay
Daniel Watkins wrote:
Hello all,
I'm currently trying to use the Python bindings to Uno to automate the
display and movement of Impress presentations. I'm using the 64-bit deb
packages from 'http://download.openoffice.org/3.0beta/'. I'm currently
doing:
import os.path
import uno
localContext = uno.getComponentContext()
resolver =
localContext.ServiceManager.createInstanceWithContext("com.sun.star.bridge.UnoUrlResolver",
localContext )
ctx = resolver.resolve(
"uno:socket,host=localhost,port=2002;urp;StarOffice.ComponentContext" )
smgr = ctx.ServiceManager
desktop = smgr.createInstanceWithContext( "com.sun.star.frame.Desktop",ctx)
url = uno.systemPathToFileUrl(os.path.abspath("foo.ppt"))
doc = desktop.loadComponentFromURL(url, "_blank", 0, () )
p = doc.getPresentation()
At this point, p is (with some formatting applied to aid readability):
pyuno object (com.sun.star.presentation.XPresentation)0xb4b238{
implementationName=com.sun.star.comp.sd.SlideShow,
supportedServices={com.sun.star.presentation.Presentation},
supportedInterfaces={
com.sun.star.presentation.XPresentation2,
com.sun.star.lang.XServiceInfo,
com.sun.star.lang.XTypeProvider,
com.sun.star.uno.XWeak,
com.sun.star.lang.XComponent
}
}
The presence in 'supportInterfaces' of
'com.sun.star.presentation.XPresentation2', suggests that 'p' should
have a 'getController' method. However, 'p' only has the following
methods:
p.addEventListener
p.dispose
p.getImplementationId
p.getImplementationName
p.getSupportedServiceNames
p.getTypes
p.queryAdapter
p.queryInterface
p.removeEventListener
p.supportsService
Can anyone shed some light on what might be going on here?
Thanks,
Dan
--
Sun Microsystems GmbH Kay Ramme
Sachsenfeld 4 Senior Technical Architect
20097 Hamburg Phone: (+49 40) 23646 982
Germany Fax: (+49 40) 23646 550
http://www.sun.com/staroffice mailto:[EMAIL PROTECTED]
http://www.sun.com/openoffice
http://udk.openoffice.org
Sun Microsystems GmbH, Sonnenallee 1, D-85551 Kirchheim-Heimstetten
Amtsgericht München: HRB 161028
Geschäftsführer: Thomas Schroeder, Wolfgang Engels, Dr. Roland Bömer
Vorsitzender des Aufsichtsrates: Martin Häring
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]