namespace com::sun::star::drawing::framework { class XConfigurationController; } namespace com::sun::star::drawing::framework { class XResourceId; } namespace com::sun::star::drawing::framework { class XView; } namespace com::sun::star::drawing::framework { struct ConfigurationChangeEvent; }
namespace sd { class ViewShellBase;
}
namespace sd::framework {
/** The FrameworkHelper is a convenience class that simplifies the accesstothedrawingframework. Ithasthreemaintasks: 1.ProvidefrequentlyusedstringsofresourceURLsandeventnames. 2.Provideshortcutsforaccessingthesdframework. 3.Easethemigrationtothedrawingframework.
NotethataFrameworkHelperdisposesitselfwhenoneoftheresource controllerscalledbyitthrowsaDisposedException.
*/ class FrameworkHelper final
: public std::enable_shared_from_this<FrameworkHelper>, public SdGlobalResource
{ public: // URLs of frequently used panes. static constexpr OUString msPaneURLPrefix = u"private:resource/pane/"_ustr; staticconst OUString msCenterPaneURL; staticconst OUString msFullScreenPaneURL; staticconst OUString msLeftImpressPaneURL; staticconst OUString msBottomImpressPaneURL; staticconst OUString msLeftDrawPaneURL;
/** Return the FrameworkHelper object that is associated with the given ViewShellBase.Ifsuchanobjectdoesnotyetexist,anewoneis created.
*/ static ::std::shared_ptr<FrameworkHelper> Instance (ViewShellBase& rBase);
/** Mark the FrameworkHelper object for the given ViewShellBase as disposed.AfollowingReleaseInstance()callwilldestroythe FrameworkHelperobject.
/** Return an identifier for the given view URL. This identifier can be usedinaswitchstatement.SeeGetViewURL()foramappinginthe oppositedirection.
*/ static ViewShell::ShellType GetViewId (const OUString& rsViewURL);
/** Return a view URL for the given identifier. See GetViewId() for a mappingintheoppositedirection.
*/ staticconst OUString & GetViewURL (ViewShell::ShellType eType);
/** Return a ViewShell pointer for the given XView reference. This assumesthatthegivenreferenceisimplementedbythe ViewShellWrapperclassthatsupportstheXTunnelinterface. @return WhentheViewShellpointercannotbeinferredfromthegiven referencethenanemptypointerisreturned.
*/ static ::std::shared_ptr<ViewShell> GetViewShell ( const css::uno::Reference<css::drawing::framework::XView>& rxView);
/** Test whether the called FrameworkHelper object is valid. @return Whentheobjecthasalreadybeendisposedthen<FALSE/>isreturned.
*/ bool IsValid() const;
/** Return a pointer to the view shell that is displayed in the specifiedpane.SeeGetView()foravariantthatreturnsa referencetoXViewinsteadofaViewShellpointer. @return Anemptypointerisreturnedwhenforexamplethespecifiedpane doesnotexistorisnotvisibleordoesnotshowavieworone oftheinvolvedobjectsdoesnotsupportXUnoTunnel(where necessary).
*/
::std::shared_ptr<ViewShell> GetViewShell (const OUString& rsPaneURL);
/** Return a reference to the view that is displayed in the specified pane.SeeGetViewShell()foravariantthatreturnsaViewShell pointerinsteadofareferencetoXView. @paramrxPaneOrViewId WhenthisResourceIdspecifiesaviewthenthatviewis returned.Whenitbelongstoapanethenoneviewinthatpane isreturned. @return Anemptyreferenceisreturnedwhenforexamplethespecifiedpane doesnotexistorisnotvisibleordoesnotshowavieworone oftheinvolvedobjectsdoesnotsupportXTunnel(where necessary).
*/
css::uno::Reference<css::drawing::framework::XView> GetView ( const css::uno::Reference<css::drawing::framework::XResourceId>& rxPaneOrViewId);
/** Request the specified view to be displayed in the specified pane. Whenthepaneisnotvisibleitscreationisalsorequested.The updatethatcreatestheactualviewobjectisdoneasynchronously. @paramrsResourceURL TheresourceURLoftheviewtoshow. @paramrsAnchorURL TheURLofthepaneinwhichtoshowtheview. @return Theresourceidoftherequestedviewisreturned.Withthat thecallercan,forexample,callRunOnResourceActivation()to dosomeinitializationaftertherequestedviewbecomesactive.
*/
css::uno::Reference<css::drawing::framework::XResourceId> RequestView ( const OUString& rsResourceURL, const OUString& rsAnchorURL);
/** Process a slot call that requests a view shell change.
*/ void HandleModeChangeSlot (
sal_uInt16 nSlotId,
SfxRequest const & rRequest);
/** Run the given callback when the specified event is notified by the ConfigurationManager.Whentherearenopendingrequestsand thereforenoeventswouldbenotified(intheforeseeablefuture) thenthecallbackiscalledimmediately. Thecallbackiscalledwithaflagthattellsthecallbackwhether theeventitwaitsforhasbeensent.
*/ void RunOnConfigurationEvent( const OUString& rsEventType, const Callback& rCallback);
/** Run the given callback when the specified resource has been activated.Whentheresourceisactivealreadywhenthismethodis calledthenrCallbackiscalledbeforethismethodreturns. @paramrxResourceId Waitfortheactivationofthisresourcebeforecalling rCallback. @paramrCallback Thecallbacktobecalledwhentheresourceisactivated.
/** Normally the requested changes of the configuration are executed asynchronously.However,thereisatleastonesituation(searching withtheOutliner)wherethesurroundingcodedoesnotcopewith this.So,insteadofcallingRescheduleuntiltheglobaleventloop executestheconfigurationupdate,thismethoddoes(almost)the samewithoutthereschedules.
/** Block until the specified event is notified by the configuration controller.Whentheconfigurationcontrollerisnotprocessingany requeststhemethodreturnsimmediately.
*/ void WaitForEvent (const OUString& rsEventName) const;
/** This is a short cut for WaitForEvent(msConfigurationUpdateEndEvent). Callthismethodtoexecutethependingrequests.
*/ void WaitForUpdate() const;
/** Explicit request for an update of the current configuration. Call thismethodwhenoneoftheresourcesmanagedbythesdframework hasbeenactivatedordeactivatedfromtheoutside,i.e.notbythe frameworkitself.Anexampleforthisisaclickonthecloser buttonofoneofthesidepanes.
*/ void UpdateConfiguration();
/** Return a string representation of the given XResourceId object.
*/ static OUString ResourceIdToString ( const css::uno::Reference<
css::drawing::framework::XResourceId>& rxResourceId);
/** Create a new XResourceId object for the given resource URL.
*/ static css::uno::Reference<
css::drawing::framework::XResourceId>
CreateResourceId ( const OUString& rsResourceURL);
/** Create a new XResourceId object for the given resource URL and a singleanchorURL.
*/ static css::uno::Reference<
css::drawing::framework::XResourceId>
CreateResourceId ( const OUString& rsResourceURL, const OUString& rsAnchorURL);
/** Create a new XResourceId object for the given resource URL.
*/ static css::uno::Reference<
css::drawing::framework::XResourceId>
CreateResourceId ( const OUString& rsResourceURL, const css::uno::Reference<
css::drawing::framework::XResourceId>& rxAnchor);
/** Run the given callback when an event of the specified type is receivedfromtheConfigurationControllerorwhenthe ConfigurationControllerhasnopendingchangerequests. @paramrsEventType RunrCallbackonlyonthisevent. @paramrFilter Thisfilterhastoreturn<TRUE/>inorderforrCallbacktobe called. @paramrCallback Thecallbackfunctortobecalled.
*/ void RunOnEvent( const OUString& rsEventType, const ConfigurationChangeEventFilter& rFilter, const Callback& rCallback) const;
/** This disposing method is forwarded from the inner DisposeListener class.
*/ void disposing (const css::lang::EventObject& rEventObject);
};
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.