diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2016-12-19 11:01:37 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2016-12-20 06:08:30 +0000 |
commit | ed2b8ca92ae00ab96b0ea2b1c3fc9be4622b61ff (patch) | |
tree | 5fe7754d4aa1e93c6aa186ff74e6f96aaecdcd74 /include/sfx2/event.hxx | |
parent | 9eb4b14ffa57cd7bbdf0fc43096f5f1e65c8e388 (diff) |
convert SFX_EVENT constants to scoped enum
SFX_EVENT_CLOSEAPP and SFX_EVENT_TOGGLEFULLSCREENMODE are never
generated,
so remove them and delete the code that receives them
Change-Id: I2d003ba73fff0b02120ba29ff58e1d2399dedf00
Reviewed-on: https://gerrit.libreoffice.org/32168
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'include/sfx2/event.hxx')
-rw-r--r-- | include/sfx2/event.hxx | 59 |
1 files changed, 47 insertions, 12 deletions
diff --git a/include/sfx2/event.hxx b/include/sfx2/event.hxx index 6137496183b6..f0fc85500c72 100644 --- a/include/sfx2/event.hxx +++ b/include/sfx2/event.hxx @@ -34,20 +34,55 @@ class SfxObjectShell; +enum class SfxEventHintId { + NONE = 0, + ActivateDoc, + CloseDoc, + CloseView, + CreateDoc, + DeactivateDoc, + DocCreated, + LoadFinished, + ModifyChanged, + OpenDoc, + PrepareCloseDoc, + PrepareCloseView, + PrintDoc, + SaveAsDoc, + SaveAsDocDone, + SaveAsDocFailed, + SaveDoc, + SaveDocDone, + SaveDocFailed, + SaveToDoc, + SaveToDocDone, + SaveToDocFailed, + StorageChanged, + ViewCreated, + VisAreaChanged, + // SW events + SwMailMerge, + SwMailMergeEnd, + SwEventPageCount, + SwEventFieldMerge, + SwEventFieldMergeFinished, + SwEventLayoutFinished, +}; + class SFX2_DLLPUBLIC SfxEventHint : public SfxHint { SfxObjectShell* pObjShell; - OUString aEventName; - sal_uInt16 nEventId; + OUString aEventName; + SfxEventHintId nEventId; public: - SfxEventHint( sal_uInt16 nId, const OUString& aName, SfxObjectShell *pObj ) + SfxEventHint( SfxEventHintId nId, const OUString& aName, SfxObjectShell *pObj ) : pObjShell(pObj), aEventName(aName), nEventId(nId) {} - sal_uInt16 GetEventId() const + SfxEventHintId GetEventId() const { return nEventId; } const OUString& GetEventName() const @@ -63,12 +98,12 @@ class SFX2_DLLPUBLIC SfxViewEventHint : public SfxEventHint css::uno::Reference< css::frame::XController2 > xViewController; public: - SfxViewEventHint( sal_uInt16 nId, const OUString& aName, SfxObjectShell *pObj, const css::uno::Reference< css::frame::XController >& xController ) + SfxViewEventHint( SfxEventHintId nId, const OUString& aName, SfxObjectShell *pObj, const css::uno::Reference< css::frame::XController >& xController ) : SfxEventHint( nId, aName, pObj ) , xViewController( xController, css::uno::UNO_QUERY ) {} - SfxViewEventHint( sal_uInt16 nId, const OUString& aName, SfxObjectShell *pObj, const css::uno::Reference< css::frame::XController2 >& xController ) + SfxViewEventHint( SfxEventHintId nId, const OUString& aName, SfxObjectShell *pObj, const css::uno::Reference< css::frame::XController2 >& xController ) : SfxEventHint( nId, aName, pObj ) , xViewController( xController ) {} @@ -85,22 +120,22 @@ class SfxPrintingHint : public SfxViewEventHint css::uno::Sequence < css::beans::PropertyValue > aOpts; public: SfxPrintingHint( - sal_Int32 nEvent, + sal_Int32 nState, const css::uno::Sequence < css::beans::PropertyValue >& rOpts, SfxObjectShell *pObj, const css::uno::Reference< css::frame::XController2 >& xController ) : SfxViewEventHint( - SFX_EVENT_PRINTDOC, + SfxEventHintId::PrintDoc, GlobalEventConfig::GetEventName( GlobalEventId::PRINTDOC ), pObj, xController ) - , mnPrintableState( nEvent ) + , mnPrintableState( nState ) , aOpts( rOpts ) {} - SfxPrintingHint( sal_Int32 nEvent ) - : SfxViewEventHint( SFX_EVENT_PRINTDOC, rtl::OUString(), nullptr, css::uno::Reference< css::frame::XController >() ) - , mnPrintableState( nEvent ) + SfxPrintingHint( sal_Int32 nState ) + : SfxViewEventHint( SfxEventHintId::PrintDoc, rtl::OUString(), nullptr, css::uno::Reference< css::frame::XController >() ) + , mnPrintableState( nState ) {} sal_Int32 GetWhich() const { return mnPrintableState; } |