diff options
author | Andrzej J. R. Hunt <andrzej@ahunt.org> | 2012-07-15 16:37:26 +0100 |
---|---|---|
committer | Michael Meeks <michael.meeks@suse.com> | 2012-08-06 10:22:56 +0100 |
commit | e697fd2de4b375ece6a69f6c0a1a09a1faffaf93 (patch) | |
tree | 916cb31590c762c04855956ac65d1d3f939399c1 /sd/source/ui/remotecontrol/Receiver.cxx | |
parent | 4b8a3e4f4c073f3db55b84f7b737d60c0e859fa7 (diff) |
Added additional commands and parsing.
Change-Id: Iae099aeb07d25435115514e1bf0c4efb31613d50
Diffstat (limited to 'sd/source/ui/remotecontrol/Receiver.cxx')
-rw-r--r-- | sd/source/ui/remotecontrol/Receiver.cxx | 52 |
1 files changed, 43 insertions, 9 deletions
diff --git a/sd/source/ui/remotecontrol/Receiver.cxx b/sd/source/ui/remotecontrol/Receiver.cxx index fa78954af8da..fce380f77ec7 100644 --- a/sd/source/ui/remotecontrol/Receiver.cxx +++ b/sd/source/ui/remotecontrol/Receiver.cxx @@ -45,6 +45,7 @@ void Receiver::parseCommand( std::vector<OString> aCommand ) fprintf( stderr, "%s\n", aCommand[i].getStr() );} fprintf( stderr, "End parse\n" ); uno::Reference<presentation::XSlideShowController> xSlideShowController; + uno::Reference<presentation::XPresentation2> xPresentation; try { uno::Reference< lang::XMultiServiceFactory > xServiceManager( ::comphelper::getProcessServiceFactory(), uno::UNO_QUERY_THROW ); @@ -52,31 +53,64 @@ void Receiver::parseCommand( std::vector<OString> aCommand ) "com.sun.star.frame.Desktop" ) , uno::UNO_QUERY_THROW ); uno::Reference< frame::XFrame > xFrame ( xFramesSupplier->getActiveFrame(), uno::UNO_QUERY_THROW ); uno::Reference<presentation::XPresentationSupplier> xPS ( xFrame->getController()->getModel(), uno::UNO_QUERY_THROW); - uno::Reference<presentation::XPresentation2> xPresentation(xPS->getPresentation(), uno::UNO_QUERY_THROW); + xPresentation = uno::Reference<presentation::XPresentation2>( + xPS->getPresentation(), uno::UNO_QUERY_THROW); // Throws an exception if now slideshow running xSlideShowController = uno::Reference<presentation::XSlideShowController>( xPresentation->getController(), uno::UNO_QUERY_THROW ); } catch ( com::sun::star::uno::RuntimeException &e ) { - return; + //return; } - if ( aCommand[0].compareTo( "transition_next" ) == 0 ) + if ( aCommand[0].equals( "transition_next" ) ) { - xSlideShowController->gotoNextEffect(); + if ( xSlideShowController.is() ) + xSlideShowController->gotoNextEffect(); } - else if ( aCommand[0].compareTo( "transition_previous" ) == 0 ) + else if ( aCommand[0].equals( "transition_previous" ) ) { - xSlideShowController->gotoPreviousEffect(); + if ( xSlideShowController.is() ) + xSlideShowController->gotoPreviousEffect(); } - else if ( aCommand[0].compareTo( "goto_slide" ) == 0 ) + else if ( aCommand[0].equals( "goto_slide" ) ) { // FIXME: if 0 returned, then not a valid number sal_Int32 aSlide = aCommand[1].toInt32(); - xSlideShowController->gotoSlideIndex( aSlide ); + if ( xSlideShowController.is() ) + xSlideShowController->gotoSlideIndex( aSlide ); + } + else if ( aCommand[0].equals( "presentation_start" ) ) + { + if ( xPresentation.is() ) + xPresentation->start(); + } + else if ( aCommand[0].equals( "presentation_stop" ) ) + { + if ( xPresentation.is() ) + xPresentation->end(); + } + else if ( aCommand[0].equals( "presentation_blank_screen" ) ) + { + sal_Int32 aColour = 0; // Default is black + if ( aCommand.size() > 1 ) + { +// aColour = FIXME: get the colour in some format from this string +// Determine the formatting first. + } + if ( xSlideShowController.is() ) + { + xSlideShowController->blankScreen( aColour ); + } + } + else if ( aCommand[0].equals( "presentation_resume" ) ) + { + if ( xSlideShowController.is() ) + { + xSlideShowController->resume(); + } } - // FIXME: remove later, this is just to test functionality //sendPreview( 0, xSlideShowController, mTransmitter ); |