Kaydet (Commit) 406edb64 authored tarafından Tor Lillqvist's avatar Tor Lillqvist

Add debug output operator<< for SfxHintId, SvMacroItemId, and SfxEventHintId

Change-Id: I36fd3efc630d99643fb7db3b89f777d4054ec87d
Reviewed-on: https://gerrit.libreoffice.org/51651Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarTor Lillqvist <tml@collabora.com>
üst b39cd7d5
...@@ -20,6 +20,9 @@ ...@@ -20,6 +20,9 @@
#define INCLUDED_SFX2_EVENT_HXX #define INCLUDED_SFX2_EVENT_HXX
#include <sal/config.h> #include <sal/config.h>
#include <ostream>
#include <sfx2/dllapi.h> #include <sfx2/dllapi.h>
#include <svl/hint.hxx> #include <svl/hint.hxx>
#include <unotools/eventcfg.hxx> #include <unotools/eventcfg.hxx>
...@@ -70,6 +73,42 @@ enum class SvMacroItemId : sal_uInt16 { ...@@ -70,6 +73,42 @@ enum class SvMacroItemId : sal_uInt16 {
SwFrmMove = 20007, SwFrmMove = 20007,
}; };
template< typename charT, typename traits >
inline std::basic_ostream<charT, traits> & operator <<(
std::basic_ostream<charT, traits> & stream, const SvMacroItemId& id )
{
switch(id)
{
case SvMacroItemId::NONE: return stream << "NONE";
case SvMacroItemId::HtmlOnSubmitForm: return stream << "HtmlOnSubmitForm";
case SvMacroItemId::HtmlOnResetForm: return stream << "HtmlOnResetForm";
case SvMacroItemId::HtmlOnGetFocus: return stream << "HtmlOnGetFocus";
case SvMacroItemId::HtmlOnLoseFocus: return stream << "HtmlOnLoseFocus";
case SvMacroItemId::HtmlOnClick: return stream << "HtmlOnClick";
case SvMacroItemId::HtmlOnClickItem: return stream << "HtmlOnClickItem";
case SvMacroItemId::HtmlOnChange: return stream << "HtmlOnChange";
case SvMacroItemId::HtmlOnSelect: return stream << "HtmlOnSelect";
case SvMacroItemId::OpenDoc: return stream << "OpenDoc";
case SvMacroItemId::PrepareCloseDoc: return stream << "PrepareCloseDoc";
case SvMacroItemId::ActivateDoc: return stream << "ActivateDoc";
case SvMacroItemId::DeactivateDoc: return stream << "DeactivateDoc";
case SvMacroItemId::OnMouseOver: return stream << "OnMouseOver";
case SvMacroItemId::OnClick: return stream << "OnClick";
case SvMacroItemId::OnMouseOut: return stream << "OnMouseOut";
case SvMacroItemId::OnImageLoadDone: return stream << "OnImageLoadDone";
case SvMacroItemId::OnImageLoadCancel: return stream << "OnImageLoadCancel";
case SvMacroItemId::OnImageLoadError: return stream << "OnImageLoadError";
case SvMacroItemId::SwObjectSelect: return stream << "SwObjectSelect";
case SvMacroItemId::SwStartInsGlossary: return stream << "SwStartInsGlossary";
case SvMacroItemId::SwEndInsGlossary: return stream << "SwEndInsGlossary";
case SvMacroItemId::SwFrmKeyInputAlpha: return stream << "SwFrmKeyInputAlpha";
case SvMacroItemId::SwFrmKeyInputNoAlpha: return stream << "SwFrmKeyInputNoAlpha";
case SvMacroItemId::SwFrmResize: return stream << "SwFrmResize";
case SvMacroItemId::SwFrmMove: return stream << "SwFrmMove";
default: return stream << "unk(" << std::to_string(int(id)) << ")";
}
}
class SfxObjectShell; class SfxObjectShell;
enum class SfxEventHintId { enum class SfxEventHintId {
...@@ -107,6 +146,47 @@ enum class SfxEventHintId { ...@@ -107,6 +146,47 @@ enum class SfxEventHintId {
SwEventLayoutFinished, SwEventLayoutFinished,
}; };
template< typename charT, typename traits >
inline std::basic_ostream<charT, traits> & operator <<(
std::basic_ostream<charT, traits> & stream, const SfxEventHintId& id )
{
switch(id)
{
case SfxEventHintId::NONE: return stream << "NONE";
case SfxEventHintId::ActivateDoc: return stream << "ActivateDoc";
case SfxEventHintId::CloseDoc: return stream << "CloseDoc";
case SfxEventHintId::CloseView: return stream << "CloseView";
case SfxEventHintId::CreateDoc: return stream << "CreateDoc";
case SfxEventHintId::DeactivateDoc: return stream << "DeactivateDoc";
case SfxEventHintId::DocCreated: return stream << "DocCreated";
case SfxEventHintId::LoadFinished: return stream << "LoadFinished";
case SfxEventHintId::ModifyChanged: return stream << "ModifyChanged";
case SfxEventHintId::OpenDoc: return stream << "OpenDoc";
case SfxEventHintId::PrepareCloseDoc: return stream << "PrepareCloseDoc";
case SfxEventHintId::PrepareCloseView: return stream << "PrepareCloseView";
case SfxEventHintId::PrintDoc: return stream << "PrintDoc";
case SfxEventHintId::SaveAsDoc: return stream << "SaveAsDoc";
case SfxEventHintId::SaveAsDocDone: return stream << "SaveAsDocDone";
case SfxEventHintId::SaveAsDocFailed: return stream << "SaveAsDocFailed";
case SfxEventHintId::SaveDoc: return stream << "SaveDoc";
case SfxEventHintId::SaveDocDone: return stream << "SaveDocDone";
case SfxEventHintId::SaveDocFailed: return stream << "SaveDocFailed";
case SfxEventHintId::SaveToDoc: return stream << "SaveToDoc";
case SfxEventHintId::SaveToDocDone: return stream << "SaveToDocDone";
case SfxEventHintId::SaveToDocFailed: return stream << "SaveToDocFailed";
case SfxEventHintId::StorageChanged: return stream << "StorageChanged";
case SfxEventHintId::ViewCreated: return stream << "ViewCreated";
case SfxEventHintId::VisAreaChanged: return stream << "VisAreaChanged";
case SfxEventHintId::SwMailMerge: return stream << "SwMailMerge";
case SfxEventHintId::SwMailMergeEnd: return stream << "SwMailMergeEnd";
case SfxEventHintId::SwEventPageCount: return stream << "SwEventPageCount";
case SfxEventHintId::SwEventFieldMerge: return stream << "SwEventFieldMerge";
case SfxEventHintId::SwEventFieldMergeFinished: return stream << "SwEventFieldMergeFinished";
case SfxEventHintId::SwEventLayoutFinished: return stream << "SwEventLayoutFinished";
default: return stream << "unk(" << std::to_string(int(id)) << ")";
}
}
class SFX2_DLLPUBLIC SfxEventHint : public SfxHint class SFX2_DLLPUBLIC SfxEventHint : public SfxHint
{ {
SfxObjectShell* pObjShell; SfxObjectShell* pObjShell;
......
...@@ -19,6 +19,8 @@ ...@@ -19,6 +19,8 @@
#ifndef INCLUDED_SVL_HINT_HXX #ifndef INCLUDED_SVL_HINT_HXX
#define INCLUDED_SVL_HINT_HXX #define INCLUDED_SVL_HINT_HXX
#include <ostream>
#include <sal/types.h> #include <sal/types.h>
#include <svl/svldllapi.h> #include <svl/svldllapi.h>
...@@ -114,6 +116,88 @@ enum class SfxHintId { ...@@ -114,6 +116,88 @@ enum class SfxHintId {
SwSplitNodeOperation, SwSplitNodeOperation,
}; };
template< typename charT, typename traits >
inline std::basic_ostream<charT, traits> & operator <<(
std::basic_ostream<charT, traits> & stream, const SfxHintId& id )
{
switch(id)
{
case SfxHintId::NONE: return stream << "NONE";
case SfxHintId::Dying: return stream << "Dying";
case SfxHintId::NameChanged: return stream << "NameChanged";
case SfxHintId::TitleChanged: return stream << "TitleChanged";
case SfxHintId::DataChanged: return stream << "DataChanged";
case SfxHintId::DocChanged: return stream << "DocChanged";
case SfxHintId::UpdateDone: return stream << "UpdateDone";
case SfxHintId::Deinitializing: return stream << "Deinitializing";
case SfxHintId::ModeChanged: return stream << "ModeChanged";
case SfxHintId::ColorsChanged: return stream << "ColorsChanged";
case SfxHintId::LanguageChanged: return stream << "LanguageChanged";
case SfxHintId::RedlineChanged: return stream << "RedlineChanged";
case SfxHintId::DocumentRepair: return stream << "DocumentRepair";
case SfxHintId::TextParaInserted: return stream << "TextParaInserted";
case SfxHintId::TextParaRemoved: return stream << "TextParaRemoved";
case SfxHintId::TextParaContentChanged: return stream << "TextParaContentChanged";
case SfxHintId::TextHeightChanged: return stream << "TextHeightChanged";
case SfxHintId::TextFormatPara: return stream << "TextFormatPara";
case SfxHintId::TextFormatted: return stream << "TextFormatted";
case SfxHintId::TextModified: return stream << "TextModified";
case SfxHintId::TextBlockNotificationStart: return stream << "TextBlockNotificationStart";
case SfxHintId::TextBlockNotificationEnd: return stream << "TextBlockNotificationEnd";
case SfxHintId::TextInputStart: return stream << "TextInputStart";
case SfxHintId::TextInputEnd: return stream << "TextInputEnd";
case SfxHintId::TextViewScrolled: return stream << "TextViewScrolled";
case SfxHintId::TextViewSelectionChanged: return stream << "TextViewSelectionChanged";
case SfxHintId::TextViewCaretChanged: return stream << "TextViewCaretChanged";
case SfxHintId::BasicDataWanted: return stream << "BasicDataWanted";
case SfxHintId::BasicDataChanged: return stream << "BasicDataChanged";
case SfxHintId::BasicInfoWanted: return stream << "BasicInfoWanted";
case SfxHintId::BasicStart: return stream << "BasicStart";
case SfxHintId::BasicStop: return stream << "BasicStop";
case SfxHintId::EditSourceParasMoved: return stream << "EditSourceParasMoved";
case SfxHintId::EditSourceSelectionChanged: return stream << "EditSourceSelectionChanged";
case SfxHintId::ScDataChanged: return stream << "ScDataChanged";
case SfxHintId::ScTableOpDirty: return stream << "ScTableOpDirty";
case SfxHintId::ScCalcAll: return stream << "ScCalcAll";
case SfxHintId::ScReference: return stream << "ScReference";
case SfxHintId::ScDrawLayerNew: return stream << "ScDrawLayerNew";
case SfxHintId::ScDbAreasChanged: return stream << "ScDbAreasChanged";
case SfxHintId::ScAreasChanged: return stream << "ScAreasChanged";
case SfxHintId::ScTablesChanged: return stream << "ScTablesChanged";
case SfxHintId::ScDrawChanged: return stream << "ScDrawChanged";
case SfxHintId::ScDocNameChanged: return stream << "ScDocNameChanged";
case SfxHintId::ScAreaLinksChanged: return stream << "ScAreaLinksChanged";
case SfxHintId::ScShowRangeFinder: return stream << "ScShowRangeFinder";
case SfxHintId::ScDocSaved: return stream << "ScDocSaved";
case SfxHintId::ScForceSetTab: return stream << "ScForceSetTab";
case SfxHintId::ScNavigatorUpdateAll: return stream << "ScNavigatorUpdateAll";
case SfxHintId::ScAnyDataChanged: return stream << "ScAnyDataChanged";
case SfxHintId::ScPrintOptions: return stream << "ScPrintOptions";
case SfxHintId::ScRefModeChanged: return stream << "ScRefModeChanged";
case SfxHintId::ScKillEditView: return stream << "ScKillEditView";
case SfxHintId::ScKillEditViewNoPaint: return stream << "ScKillEditViewNoPaint";
case SfxHintId::ScHiddenRowsChanged: return stream << "ScHiddenRowsChanged";
case SfxHintId::ScSelectionChanged: return stream << "ScSelectionChanged";
case SfxHintId::ScClearCache: return stream << "ScClearCache";
case SfxHintId::ScAccTableChanged: return stream << "ScAccTableChanged";
case SfxHintId::ScAccCursorChanged: return stream << "ScAccCursorChanged";
case SfxHintId::ScAccVisAreaChanged: return stream << "ScAccVisAreaChanged";
case SfxHintId::ScAccEnterEditMode: return stream << "ScAccEnterEditMode";
case SfxHintId::ScAccLeaveEditMode: return stream << "ScAccLeaveEditMode";
case SfxHintId::ScAccMakeDrawLayer: return stream << "ScAccMakeDrawLayer";
case SfxHintId::ScAccWindowResized: return stream << "ScAccWindowResized";
case SfxHintId::StyleSheetCreated: return stream << "StyleSheetCreated";
case SfxHintId::StyleSheetModified: return stream << "StyleSheetModified";
case SfxHintId::StyleSheetChanged: return stream << "StyleSheetChanged";
case SfxHintId::StyleSheetErased: return stream << "StyleSheetErased";
case SfxHintId::StyleSheetInDestruction: return stream << "StyleSheetInDestruction";
case SfxHintId::MathFormatChanged: return stream << "MathFormatChanged";
case SfxHintId::SwDrawViewsCreated: return stream << "SwDrawViewsCreated";
case SfxHintId::SwSplitNodeOperation: return stream << "SwSplitNodeOperation";
default: return stream << "unk(" << std::to_string(int(id)) << ")";
}
}
class SVL_DLLPUBLIC SfxHint class SVL_DLLPUBLIC SfxHint
{ {
private: private:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment