On Tue, Oct 13, 2009 at 1:45 PM, Ariel Constenla-Haile <[email protected]> wrote: > Hello Dustin, > > On Tuesday 13 October 2009, 16:13, Dustin Breese wrote: >> I'm very new to the api, but have figured out how to get a slide show >> to open and query a few things about it such as the number of pages, >> etc. However, when I obtain the XPresentation2 reference and query it >> for the XSlideShowController, it is returning null. How do I get a >> reference to the XSlideShowController? > > you don't have a SlideShow controller if there is no slide show to control, > that is: start the slide show to get a controller, something like: > > > XPresentationSupplier xPresentationSupplier = > (XPresentationSupplier) UnoRuntime.queryInterface( > XPresentationSupplier.class, xComponent); > > XPresentation xPresentation_ = > xPresentationSupplier.getPresentation(); > XPresentation2 xPresentation = (XPresentation2) > UnoRuntime.queryInterface( > XPresentation2.class, xPresentation_); > > PropertyValue[] aPresentationArgs = new PropertyValue[3]; > > aPresentationArgs[0] = new PropertyValue(); > aPresentationArgs[0].Name = "IsAlwaysOnTop"; > aPresentationArgs[0].Value = Boolean.TRUE; > > aPresentationArgs[1] = new PropertyValue(); > aPresentationArgs[1].Name = "IsFullScreen"; > aPresentationArgs[1].Value = Boolean.FALSE; > > aPresentationArgs[2] = new PropertyValue(); > aPresentationArgs[2].Name = "IsAutomatic"; > aPresentationArgs[2].Value = Boolean.TRUE; > > xPresentation.startWithArguments(aPresentationArgs); > > // maybe put the thread to sleep a little...? > if (xPresentation.isRunning()) { > xSlideShowController = xPresentation.getController(); > > if (xSlideShowController != null) { > xSlideShowController.addSlideShowListener(this); > m_bIsListening = true; > } > } > > > > Regards > -- > Ariel Constenla-Haile > La Plata, Argentina > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] > >
That was the missing link -- pausing after the "start()". I'm now able to control the slide show properly and get the reference to the XSlideShowController. Muchas Gracias! Dustin --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
