diff options
Diffstat (limited to 'sdext/source')
-rw-r--r-- | sdext/source/presenter/PresenterController.cxx | 14 | ||||
-rw-r--r-- | sdext/source/presenter/PresenterController.hxx | 12 | ||||
-rw-r--r-- | sdext/source/presenter/PresenterProtocolHandler.cxx | 28 | ||||
-rw-r--r-- | sdext/source/presenter/PresenterToolBar.cxx | 10 |
4 files changed, 63 insertions, 1 deletions
diff --git a/sdext/source/presenter/PresenterController.cxx b/sdext/source/presenter/PresenterController.cxx index ce3e365952c2..d33db36ac460 100644 --- a/sdext/source/presenter/PresenterController.cxx +++ b/sdext/source/presenter/PresenterController.cxx @@ -70,6 +70,10 @@ namespace { namespace sdext { namespace presenter { +IPresentationTime::~IPresentationTime() +{ +} + PresenterController::InstanceContainer PresenterController::maInstances; ::rtl::Reference<PresenterController> PresenterController::Instance ( @@ -704,6 +708,16 @@ void PresenterController::RequestViews ( } } +void PresenterController::SetPresentationTime(IPresentationTime* pPresentationTime) +{ + mpPresentationTime = pPresentationTime; +} + +IPresentationTime* PresenterController::GetPresentationTime() +{ + return mpPresentationTime; +} + //----- XConfigurationChangeListener ------------------------------------------ void SAL_CALL PresenterController::notifyConfigurationChange ( diff --git a/sdext/source/presenter/PresenterController.hxx b/sdext/source/presenter/PresenterController.hxx index f7a7023a5f3f..06548f0b213c 100644 --- a/sdext/source/presenter/PresenterController.hxx +++ b/sdext/source/presenter/PresenterController.hxx @@ -68,6 +68,14 @@ namespace { > PresenterControllerInterfaceBase; } +/// Represents an element in the toolbar that shows the time elapsed since the presentation started. +class IPresentationTime +{ +public: + virtual void restart() = 0; + virtual ~IPresentationTime(); +}; + /** The controller of the presenter screen is responsible for telling the individual views which slides to show. Additionally it provides access to frequently used values of the current theme. @@ -133,6 +141,9 @@ public: const bool bIsNotesViewActive, const bool bIsHelpViewActive); + void SetPresentationTime(IPresentationTime* pPresentationTime); + IPresentationTime* GetPresentationTime(); + // XConfigurationChangeListener virtual void SAL_CALL notifyConfigurationChange ( @@ -215,6 +226,7 @@ private: css::uno::Reference<css::util::XURLTransformer> mxUrlTransformer; ::rtl::Reference<PresenterAccessible> mpAccessibleObject; bool mbIsAccessibilityActive; + IPresentationTime* mpPresentationTime; void GetSlides (const sal_Int32 nOffset); void UpdateViews(); diff --git a/sdext/source/presenter/PresenterProtocolHandler.cxx b/sdext/source/presenter/PresenterProtocolHandler.cxx index 9dbefb239ca3..709a22e66e2d 100644 --- a/sdext/source/presenter/PresenterProtocolHandler.cxx +++ b/sdext/source/presenter/PresenterProtocolHandler.cxx @@ -104,6 +104,17 @@ namespace { rtl::Reference<PresenterController> mpPresenterController; }; + /// This command restarts the presentation timer. + class RestartTimerCommand : public Command + { + public: + explicit RestartTimerCommand(const rtl::Reference<PresenterController>& rpPresenterController); + virtual ~RestartTimerCommand(); + virtual void Execute() SAL_OVERRIDE; + private: + rtl::Reference<PresenterController> mpPresenterController; + }; + class SetNotesViewCommand : public Command { public: @@ -408,6 +419,8 @@ Command* PresenterProtocolHandler::Dispatch::CreateCommand ( return new GotoPreviousSlideCommand(rpPresenterController); if (rsURLPath == "SwitchMonitor") return new SwitchMonitorCommand(rpPresenterController); + if (rsURLPath == "RestartTimer") + return new RestartTimerCommand(rpPresenterController); if (rsURLPath == "ShowNotes") return new SetNotesViewCommand(true, rpPresenterController); if (rsURLPath == "ShowSlideSorter") @@ -612,6 +625,21 @@ void SwitchMonitorCommand::Execute() mpPresenterController->SwitchMonitors(); } +RestartTimerCommand::RestartTimerCommand (const rtl::Reference<PresenterController>& rpPresenterController) +: mpPresenterController(rpPresenterController) +{ +} + +RestartTimerCommand::~RestartTimerCommand() +{ +} + +void RestartTimerCommand::Execute() +{ + if (IPresentationTime* pPresentationTime = mpPresenterController->GetPresentationTime()) + pPresentationTime->restart(); +} + //===== SetNotesViewCommand =================================================== SetNotesViewCommand::SetNotesViewCommand ( diff --git a/sdext/source/presenter/PresenterToolBar.cxx b/sdext/source/presenter/PresenterToolBar.cxx index 3b102475398d..0b514b3e3850 100644 --- a/sdext/source/presenter/PresenterToolBar.cxx +++ b/sdext/source/presenter/PresenterToolBar.cxx @@ -310,7 +310,7 @@ namespace { virtual void TimeHasChanged (const oslDateTime& rCurrentTime) SAL_OVERRIDE; }; - class PresentationTimeLabel : public TimeLabel + class PresentationTimeLabel : public TimeLabel, public IPresentationTime { public: static ::rtl::Reference<Element> Create ( @@ -320,6 +320,7 @@ namespace { const SharedElementMode& rpMouseOverMode, const SharedElementMode& rpSelectedMode, const SharedElementMode& rpDisabledMode) SAL_OVERRIDE; + virtual void restart() SAL_OVERRIDE; private: TimeFormatter maTimeFormatter; TimeValue maStartTimeValue; @@ -1909,6 +1910,7 @@ void CurrentTimeLabel::SetModes ( PresentationTimeLabel::~PresentationTimeLabel() { + mpToolBar->GetPresenterController()->SetPresentationTime(0); } PresentationTimeLabel::PresentationTimeLabel ( @@ -1917,6 +1919,12 @@ PresentationTimeLabel::PresentationTimeLabel ( maTimeFormatter(), maStartTimeValue() { + restart(); + mpToolBar->GetPresenterController()->SetPresentationTime(this); +} + +void PresentationTimeLabel::restart() +{ maStartTimeValue.Seconds = 0; maStartTimeValue.Nanosec = 0; } |