summaryrefslogtreecommitdiff
path: root/sdext
diff options
context:
space:
mode:
authorSrijan Bhatia <srijanbhatiasun@gmail.com>2020-06-24 20:35:00 +0530
committerHeiko Tietze <heiko.tietze@documentfoundation.org>2020-06-27 12:01:23 +0200
commite13ba48c7ff428ee0da29ee3bbb29ee3a1063540 (patch)
treeb258238065b28d8d0db604753b618f80b757f669 /sdext
parente318e4cea37f6adb20cffc913655c0e6dbabe45a (diff)
tdf#90978 add exit button to impress presenter console
Change-Id: If8a5226d700eb7a4137218191b5abc85bbb36b4d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97041 Tested-by: Jenkins Tested-by: Heiko Tietze <heiko.tietze@documentfoundation.org> Reviewed-by: Heiko Tietze <heiko.tietze@documentfoundation.org>
Diffstat (limited to 'sdext')
-rw-r--r--sdext/source/presenter/PresenterController.cxx14
-rw-r--r--sdext/source/presenter/PresenterController.hxx1
-rw-r--r--sdext/source/presenter/PresenterProtocolHandler.cxx26
3 files changed, 41 insertions, 0 deletions
diff --git a/sdext/source/presenter/PresenterController.cxx b/sdext/source/presenter/PresenterController.cxx
index c37ee6f8b097..281f77e59d5e 100644
--- a/sdext/source/presenter/PresenterController.cxx
+++ b/sdext/source/presenter/PresenterController.cxx
@@ -1157,6 +1157,20 @@ void PresenterController::SwitchMonitors()
pScreen->SwitchMonitors();
}
+void PresenterController::ExitPresenter()
+{
+ if( mxController.is() )
+ {
+ Reference< XPresentationSupplier > xPS( mxController->getModel(), UNO_QUERY );
+ if( xPS.is() )
+ {
+ Reference< XPresentation > xP( xPS->getPresentation() );
+ if( xP.is() )
+ xP->end();
+ }
+ }
+}
+
} // end of namespace ::sdext::presenter
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sdext/source/presenter/PresenterController.hxx b/sdext/source/presenter/PresenterController.hxx
index 400fb9174f11..1a9d8a1aaa04 100644
--- a/sdext/source/presenter/PresenterController.hxx
+++ b/sdext/source/presenter/PresenterController.hxx
@@ -110,6 +110,7 @@ public:
void ShowView (const OUString& rsViewURL);
void HideView (const OUString& rsViewURL);
void SwitchMonitors();
+ void ExitPresenter();
void DispatchUnoCommand (const OUString& rsCommand) const;
css::uno::Reference<css::frame::XDispatch> GetDispatch (
const css::util::URL& rURL) const;
diff --git a/sdext/source/presenter/PresenterProtocolHandler.cxx b/sdext/source/presenter/PresenterProtocolHandler.cxx
index 029365e3b21d..64b00fd36f67 100644
--- a/sdext/source/presenter/PresenterProtocolHandler.cxx
+++ b/sdext/source/presenter/PresenterProtocolHandler.cxx
@@ -164,6 +164,15 @@ namespace {
const sal_Int32 mnSizeChange;
};
+ class ExitPresenterCommand : public Command
+ {
+ public:
+ explicit ExitPresenterCommand(const rtl::Reference<PresenterController>& rpPresenterController);
+ virtual void Execute() override;
+ private:
+ rtl::Reference<PresenterController> mpPresenterController;
+ };
+
} // end of anonymous namespace
namespace {
@@ -398,6 +407,8 @@ Command* PresenterProtocolHandler::Dispatch::CreateCommand (
return new SetHelpViewCommand(true, rpPresenterController);
if (rsURLPath == "ShrinkNotesFont")
return new NotesFontSizeCommand(rpPresenterController, -1);
+ if (rsURLPath == "ExitPresenter")
+ return new ExitPresenterCommand(rpPresenterController);
return nullptr;
}
@@ -805,6 +816,21 @@ Any NotesFontSizeCommand::GetState() const
return Any();
}
+//===== ExitPresenterCommand ==================================================
+
+ExitPresenterCommand::ExitPresenterCommand (const rtl::Reference<PresenterController>& rpPresenterController)
+: mpPresenterController(rpPresenterController)
+{
+}
+
+void ExitPresenterCommand::Execute()
+{
+ if ( ! mpPresenterController.is())
+ return;
+
+ mpPresenterController->ExitPresenter();
+}
+
} // end of namespace ::sdext::presenter
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */