diff options
Diffstat (limited to 'sd/source/ui/inc/framework/FrameworkHelper.hxx')
-rw-r--r-- | sd/source/ui/inc/framework/FrameworkHelper.hxx | 132 |
1 files changed, 88 insertions, 44 deletions
diff --git a/sd/source/ui/inc/framework/FrameworkHelper.hxx b/sd/source/ui/inc/framework/FrameworkHelper.hxx index 9c9c642b98a2..d8ac6a321c44 100644 --- a/sd/source/ui/inc/framework/FrameworkHelper.hxx +++ b/sd/source/ui/inc/framework/FrameworkHelper.hxx @@ -48,6 +48,8 @@ class OUString; } namespace css = ::com::sun::star; +namespace cssu = ::com::sun::star::uno; +namespace cssdf = ::com::sun::star::drawing::framework; namespace sd { namespace framework { @@ -56,10 +58,10 @@ namespace sd { namespace framework { It has three main tasks: 1. Provide frequently used strings of resource URLs and event names. 2. Provide shortcuts for accessing the sd framework. - 3. Easy the migration to the drawing framwork. + 3. Ease the migration to the drawing framwork. Note that a FrameworkHelper disposes itself when one of the resource - controllers called by it throw a DisposedException. + controllers called by it throws a DisposedException. */ class FrameworkHelper : public ::boost::enable_shared_from_this<FrameworkHelper>, @@ -72,7 +74,7 @@ public: static const ::rtl::OUString msFullScreenPaneURL; static const ::rtl::OUString msLeftImpressPaneURL; static const ::rtl::OUString msLeftDrawPaneURL; - static const ::rtl::OUString msRightPaneURL; + static const ::rtl::OUString msSidebarPaneURL; // URLs of frequently used views. static const ::rtl::OUString msViewURLPrefix; @@ -83,7 +85,7 @@ public: static const ::rtl::OUString msHandoutViewURL; static const ::rtl::OUString msSlideSorterURL; static const ::rtl::OUString msPresentationViewURL; - static const ::rtl::OUString msTaskPaneURL; + static const ::rtl::OUString msSidebarViewURL; // URLs of frequently used tool bars. static const ::rtl::OUString msToolBarURLPrefix; @@ -91,7 +93,9 @@ public: // URLs of task panels. static const ::rtl::OUString msTaskPanelURLPrefix; - static const ::rtl::OUString msMasterPagesTaskPanelURL; + static const ::rtl::OUString msAllMasterPagesTaskPanelURL; + static const ::rtl::OUString msRecentMasterPagesTaskPanelURL; + static const ::rtl::OUString msUsedMasterPagesTaskPanelURL; static const ::rtl::OUString msLayoutTaskPanelURL; static const ::rtl::OUString msTableDesignPanelURL; static const ::rtl::OUString msCustomAnimationTaskPanelURL; @@ -102,6 +106,7 @@ public: static const ::rtl::OUString msResourceDeactivationRequestEvent; static const ::rtl::OUString msResourceActivationEvent; static const ::rtl::OUString msResourceDeactivationEvent; + static const ::rtl::OUString msResourceDeactivationEndEvent; static const ::rtl::OUString msConfigurationUpdateStartEvent; static const ::rtl::OUString msConfigurationUpdateEndEvent; @@ -116,7 +121,7 @@ public: static ::boost::shared_ptr<FrameworkHelper> Instance (ViewShellBase& rBase); static ::boost::shared_ptr<FrameworkHelper> Instance ( - const css::uno::Reference<css::frame::XController>& rxController); + const cssu::Reference<css::frame::XController>& rxController); /** Mark the FrameworkHelper object for the given ViewShellBase as disposed. A following ReleaseInstance() call will destroy the @@ -153,17 +158,15 @@ public: reference then an empty pointer is returned. */ static ::boost::shared_ptr<ViewShell> GetViewShell ( - const css::uno::Reference<css::drawing::framework::XView>& rxView); + const cssu::Reference<cssdf::XView>& rxView); - ~FrameworkHelper (void); - - typedef ::boost::function<bool(const css::drawing::framework::ConfigurationChangeEvent&)> + typedef ::boost::function<bool(const cssdf::ConfigurationChangeEvent&)> ConfigurationChangeEventFilter; typedef ::boost::function<void(bool bEventSeen)> Callback; typedef ::boost::function< void( - const css::uno::Reference< - css::drawing::framework::XResourceId>&) + const cssu::Reference< + cssdf::XResourceId>&) > ResourceFunctor; /** Test whether the called FrameworkHelper object is valid. @@ -196,10 +199,19 @@ public: of the involved objects does not support XTunnel (where necessary). */ - css::uno::Reference<css::drawing::framework::XView> - GetView ( - const css::uno::Reference< - css::drawing::framework::XResourceId>& rxPaneOrViewId); + cssu::Reference<cssdf::XView> GetView ( + const cssu::Reference<cssdf::XResourceId>& rxPaneOrViewId); + + /** Return the XWindow that is represented by the pane with the + given resource id. + */ + cssu::Reference<css::awt::XWindow> GetPaneWindow ( + const cssu::Reference<cssdf::XResourceId>& rxPaneId); + + /** Return the XResource object with the given resource id. + */ + cssu::Reference<cssdf::XResource> GetResource ( + const cssu::Reference<cssdf::XResourceId>& rxResourceId); /** Request the specified view to be displayed in the specified pane. When the pane is not visible its creation is also requested. The @@ -213,25 +225,34 @@ public: the caller can, for example, call RunOnResourceActivation() to do some initialization after the requested view becomes active. */ - css::uno::Reference<css::drawing::framework::XResourceId> RequestView ( + cssu::Reference<cssdf::XResourceId> RequestView ( const ::rtl::OUString& rsResourceURL, const ::rtl::OUString& rsAnchorURL); - /** Request the activation of the specified task panel in the standard - task pane. - @param rsTaskPanelURL + /** Request the activation of the specified panel in the + sidebar. + @param rsSidebarPanelURL The panel that is to be activated. - @param bEnsureTaskPaneIsVisible - When this is <TRUE/> then the task pane is activated when not + @param bEnsurePaneIsVisible + When this is <TRUE/> then the sidebar pane is activated when not yet active. When this flag is <FALSE/> then the requested panel is activated only when the task pane is already active. When it is not active then this call is silently ignored. + @return + The resource id of the requested sidebar panel is returned. With that + the caller can, for example, call RunOnResourceActivation() to + do some initialization after the requested view becomes active. */ - void RequestTaskPanel ( - const ::rtl::OUString& rsTaskPanelURL, + cssu::Reference<cssdf::XResourceId> RequestSidebarPanel ( + const ::rtl::OUString& rsSidebarPanelURL, const bool bEnsureTaskPaneIsVisible = true); + /** Request the deactivation of the specified resource. + */ + void RequestResourceDeactivation ( + const cssu::Reference<cssdf::XResourceId>& rxResourceId); + /** Process a slot call that requests a view shell change. */ void HandleModeChangeSlot ( @@ -260,9 +281,30 @@ public: */ void RunOnResourceActivation( - const css::uno::Reference<css::drawing::framework::XResourceId>& rxResourceId, + const cssu::Reference<cssdf::XResourceId>& rxResourceId, const Callback& rCallback); + /** Run the given callback when the specified resource has been + deactivated. When the resource is not active already when + this method is called then rCallback is called before this + method returns. + @param rxResourceId + Wait for the deactivation of this resource before calling + rCallback. + @param rCallback + The callback to be called when the resource is + deactivated. + @param bRunOnDeactivationEnd + The callback is run either when the deactivation starts + and the callback can still access the resource or when the + deactivatio is complete and the resource is no longer available. + + */ + void RunOnResourceDeactivation( + const cssu::Reference<cssdf::XResourceId>& rxResourceId, + const Callback& rCallback, + const bool bRunOnDeactivationEnd); + /** Normally the requested changes of the configuration are executed asynchronously. However, there is at least one situation (searching with the Outliner) where the surrounding code does not cope with @@ -296,21 +338,21 @@ public: /** Return a string representation of the given XResourceId object. */ static ::rtl::OUString ResourceIdToString ( - const css::uno::Reference< - css::drawing::framework::XResourceId>& rxResourceId); + const cssu::Reference< + cssdf::XResourceId>& rxResourceId); /** Create a new XResourceId object for the given resource URL. */ - static css::uno::Reference< - css::drawing::framework::XResourceId> + static cssu::Reference< + cssdf::XResourceId> CreateResourceId ( const ::rtl::OUString& rsResourceURL); /** Create a new XResourceId object for the given resource URL and a single anchor URL. */ - static css::uno::Reference< - css::drawing::framework::XResourceId> + static cssu::Reference< + cssdf::XResourceId> CreateResourceId ( const ::rtl::OUString& rsResourceURL, const ::rtl::OUString& rsAnchorURL); @@ -318,8 +360,8 @@ public: /** Create a new XResourceId object for the given resource URL and the two given anchor URLs. */ - static css::uno::Reference< - css::drawing::framework::XResourceId> + static cssu::Reference< + cssdf::XResourceId> CreateResourceId ( const ::rtl::OUString& rsResourceURL, const ::rtl::OUString& rsFirstAnchorURL, @@ -327,14 +369,14 @@ public: /** Create a new XResourceId object for the given resource URL. */ - static css::uno::Reference< - css::drawing::framework::XResourceId> + static cssu::Reference< + cssdf::XResourceId> CreateResourceId ( const ::rtl::OUString& rsResourceURL, - const css::uno::Reference< - css::drawing::framework::XResourceId>& rxAnchor); + const cssu::Reference< + cssdf::XResourceId>& rxAnchor); - css::uno::Reference<css::drawing::framework::XConfigurationController> + cssu::Reference<cssdf::XConfigurationController> GetConfigurationController (void) const; @@ -350,16 +392,18 @@ private: static ::boost::scoped_ptr<ViewURLMap> mpViewURLMap; ViewShellBase& mrBase; - css::uno::Reference<css::drawing::framework::XConfigurationController> + cssu::Reference<cssdf::XConfigurationController> mxConfigurationController; class DisposeListener; friend class DisposeListener; - css::uno::Reference<css::lang::XComponent> + cssu::Reference<css::lang::XComponent> mxDisposeListener; FrameworkHelper (ViewShellBase& rBase); FrameworkHelper (const FrameworkHelper& rHelper); // Not implemented. + ~FrameworkHelper (void); + class Deleter; friend class Deleter; FrameworkHelper& operator= (const FrameworkHelper& rHelper); // Not implemented. void Initialize (void); @@ -399,7 +443,7 @@ namespace { class FrameworkHelperAllPassFilter { public: - bool operator() (const css::drawing::framework::ConfigurationChangeEvent&) { return true; } + bool operator() (const cssdf::ConfigurationChangeEvent&) { return true; } }; @@ -407,12 +451,12 @@ namespace { { public: FrameworkHelperResourceIdFilter ( - const css::uno::Reference<css::drawing::framework::XResourceId>& rxResourceId); - bool operator() (const css::drawing::framework::ConfigurationChangeEvent& rEvent) + const cssu::Reference<cssdf::XResourceId>& rxResourceId); + bool operator() (const cssdf::ConfigurationChangeEvent& rEvent) { return mxResourceId.is() && rEvent.ResourceId.is() && mxResourceId->compareTo(rEvent.ResourceId) == 0; } private: - css::uno::Reference<css::drawing::framework::XResourceId> mxResourceId; + cssu::Reference<cssdf::XResourceId> mxResourceId; }; } // end of anonymous namespace |