diff options
author | Andrzej J. R. Hunt <andrzej@ahunt.org> | 2012-07-17 17:48:07 +0200 |
---|---|---|
committer | Michael Meeks <michael.meeks@suse.com> | 2012-08-06 10:22:57 +0100 |
commit | d57230d33811aa317b53e12c3d81f5d7d7bc93c8 (patch) | |
tree | 4148b14f78318183cb8b8848db805c8382c24519 /sd/source/ui/remotecontrol/Listener.cxx | |
parent | a1e8ed9831d7f7af45932841244b4551a5a92ad3 (diff) |
Added registration of the slideshow listener.
Change-Id: I Icaf2fe03e5f5b8ee9de3138b8dd28d837c734e94
Diffstat (limited to 'sd/source/ui/remotecontrol/Listener.cxx')
-rw-r--r-- | sd/source/ui/remotecontrol/Listener.cxx | 54 |
1 files changed, 6 insertions, 48 deletions
diff --git a/sd/source/ui/remotecontrol/Listener.cxx b/sd/source/ui/remotecontrol/Listener.cxx index 47cf1fa3b90f..25f51077221e 100644 --- a/sd/source/ui/remotecontrol/Listener.cxx +++ b/sd/source/ui/remotecontrol/Listener.cxx @@ -18,50 +18,14 @@ using namespace ::com::sun::star::frame; using rtl::OString; -Listener::Listener( css::uno::Reference< css::presentation::XSlideShowController > aController, sd::Transmitter& rTransmitter ) - : ::cppu::WeakComponentImplHelper2< XSlideShowListener, - XFrameActionListener >( m_aMutex ) +Listener::Listener( sd::Transmitter& rTransmitter ) + : ::cppu::WeakComponentImplHelper1< XSlideShowListener>( m_aMutex ) { - fprintf( stderr, "Hello from a listener...\n" ); - try - { - css::uno::Reference< css::lang::XMultiServiceFactory > xServiceManager( - ::comphelper::getProcessServiceFactory(), css::uno::UNO_QUERY_THROW ); - css::uno::Reference< css::frame::XFrame > xDesktop( xServiceManager->createInstance( - "com.sun.star.frame.Desktop" ) , css::uno::UNO_QUERY_THROW ); - xDesktop->addFrameActionListener( static_cast<XFrameActionListener*>(this)); - } - catch ( css::uno::RuntimeException &e ) - { - //return; - } - if( aController.is() ) - { -// css::uno::Reference< css::lang::XMultiServiceFactory > xServiceManager( -// ::comphelper::getProcessServiceFactory(), css::uno::UNO_QUERY_THROW ); -// css::uno::Reference< css::frame::XFramesSupplier > xFramesSupplier( -// xServiceManager->createInstance( "com.sun.star.frame.Desktop" ) , -// css::uno::UNO_QUERY_THROW ); -// css::uno::Reference< css::frame::XFrame > xFrame ( -// xFramesSupplier->getActiveFrame(), css::uno::UNO_QUERY_THROW ); -// css::uno::Reference<css::presentation::XPresentationSupplier> xPS ( -// xFrame->getController()->getModel(), css::uno::UNO_QUERY_THROW); -// css::uno::Reference<css::presentation::XPresentation2> xPresentation( -// xPS->getPresentation(), css::uno::UNO_QUERY_THROW); -// // Throws an exception if now slideshow running -// css::uno::Reference<css::presentation::XSlideShowController> xSlideShowController( -// xPresentation->getController(), css::uno::UNO_QUERY_THROW ); -// xSlideShowController->addSlideShowListener(static_cast<XSlideShowListener*>(this)); -// fprintf(stderr, "Registered the slideshowlistener\n" ); - fprintf(stderr, "Trying to add the slideshowlistener\n" ); - aController->addSlideShowListener(static_cast<XSlideShowListener*>(this)); - fprintf(stderr, "Registered the slideshowlistener\n" ); - } - else - { - fprintf(stderr, "rController isn't\n" ); - } +} +void Listener::init(css::uno::Reference< css::presentation::XSlideShowController > aController) +{ + aController->addSlideShowListener(static_cast<XSlideShowListener*>(this)); } @@ -161,12 +125,6 @@ void SAL_CALL Listener::slideAnimationsEnded (void) { } -void SAL_CALL Listener::frameAction (const css::frame::FrameActionEvent& rEvent) - throw (::com::sun::star::uno::RuntimeException) -{ - fprintf( stderr, "FrameAction\n" ); -} - void SAL_CALL Listener::disposing (void) { // FIXME: disconnect as appropriate |