summaryrefslogtreecommitdiff
path: root/svtools
diff options
context:
space:
mode:
authorJens-Heiner Rechtien <hr@openoffice.org>2009-09-18 10:15:03 +0000
committerJens-Heiner Rechtien <hr@openoffice.org>2009-09-18 10:15:03 +0000
commit3663a7fc5910ff2c7f8959bd024e935eadfaf4c2 (patch)
tree94fbdfa7b25b5549f2aac70be2e89f9fc221834d /svtools
parent87f5ad0c1a30ba7853de37e56413e8f1f9669560 (diff)
CWS-TOOLING: integrate CWS mba32issues02
2009-09-17 mb93783 merge commit 2009-09-03 tb121644 #i104748 - slot unification to .uno:PasteSpecial 2009-09-01 mba #101455#: code simplification 2009-08-31 mb93783 iso locales for norwegian builds are nb and nn, not no 2009-08-25 mba merge to m55 2009-07-29 mba cleanup after rebase 2009-07-29 mba #i103200#: wrong order of first and last name in CJK UI 2009-07-27 mba adding dictionary changes from broken svn CWS 2009-07-27 mba adding dictionary changes from broken svn CWS 2009-07-27 mba apply patch from broken svn CWS
Diffstat (limited to 'svtools')
-rw-r--r--svtools/inc/eventcfg.hxx33
-rw-r--r--svtools/source/config/eventcfg.cxx88
2 files changed, 105 insertions, 16 deletions
diff --git a/svtools/inc/eventcfg.hxx b/svtools/inc/eventcfg.hxx
index 4478d3f48028..4ee175f5b7e0 100644
--- a/svtools/inc/eventcfg.hxx
+++ b/svtools/inc/eventcfg.hxx
@@ -40,6 +40,35 @@
#include <hash_map>
#include <vector>
+#define STR_EVENT_STARTAPP 0
+#define STR_EVENT_CLOSEAPP 1
+#define STR_EVENT_DOCCREATED 2
+#define STR_EVENT_CREATEDOC 3
+#define STR_EVENT_LOADFINISHED 4
+#define STR_EVENT_OPENDOC 5
+#define STR_EVENT_PREPARECLOSEDOC 6
+#define STR_EVENT_CLOSEDOC 7
+#define STR_EVENT_SAVEDOC 8
+#define STR_EVENT_SAVEDOCDONE 9
+#define STR_EVENT_SAVEDOCFAILED 10
+#define STR_EVENT_SAVEASDOC 11
+#define STR_EVENT_SAVEASDOCDONE 12
+#define STR_EVENT_SAVEASDOCFAILED 13
+#define STR_EVENT_SAVETODOC 14
+#define STR_EVENT_SAVETODOCDONE 15
+#define STR_EVENT_SAVETODOCFAILED 16
+#define STR_EVENT_ACTIVATEDOC 17
+#define STR_EVENT_DEACTIVATEDOC 18
+#define STR_EVENT_PRINTDOC 19
+#define STR_EVENT_VIEWCREATED 20
+#define STR_EVENT_PREPARECLOSEVIEW 21
+#define STR_EVENT_CLOSEVIEW 22
+#define STR_EVENT_MODIFYCHANGED 23
+#define STR_EVENT_TITLECHANGED 24
+#define STR_EVENT_VISAREACHANGED 25
+#define STR_EVENT_MODECHANGED 26
+#define STR_EVENT_STORAGECHANGED 27
+
typedef ::std::hash_map< ::rtl::OUString, ::rtl::OUString, ::rtl::OUStringHash, ::std::equal_to< ::rtl::OUString > > EventBindingHash;
typedef ::std::vector< ::com::sun::star::uno::WeakReference< ::com::sun::star::frame::XFrame > > FrameVector;
typedef ::std::vector< ::rtl::OUString > SupportedEventsVector;
@@ -67,7 +96,7 @@ public:
::sal_Bool SAL_CALL hasByName( const ::rtl::OUString& aName ) throw (::com::sun::star::uno::RuntimeException);
::com::sun::star::uno::Type SAL_CALL getElementType( ) throw (::com::sun::star::uno::RuntimeException);
::sal_Bool SAL_CALL hasElements( ) throw (::com::sun::star::uno::RuntimeException);
-
+ ::rtl::OUString GetEventName( sal_Int32 nID );
};
class SVL_DLLPUBLIC GlobalEventConfig:
@@ -86,7 +115,7 @@ class SVL_DLLPUBLIC GlobalEventConfig:
::sal_Bool SAL_CALL hasByName( const ::rtl::OUString& aName ) throw (::com::sun::star::uno::RuntimeException);
::com::sun::star::uno::Type SAL_CALL getElementType( ) throw (::com::sun::star::uno::RuntimeException);
::sal_Bool SAL_CALL hasElements( ) throw (::com::sun::star::uno::RuntimeException);
-
+ static ::rtl::OUString GetEventName( sal_Int32 nID );
private:
static GlobalEventConfig_Impl* m_pImpl;
diff --git a/svtools/source/config/eventcfg.cxx b/svtools/source/config/eventcfg.cxx
index ae2041356fd3..6026c3d4a3a0 100644
--- a/svtools/source/config/eventcfg.cxx
+++ b/svtools/source/config/eventcfg.cxx
@@ -62,24 +62,70 @@ using namespace ::com::sun::star;
#define SETNODE_BINDINGS OUString(RTL_CONSTASCII_USTRINGPARAM("Bindings" ))
#define PROPERTYNAME_BINDINGURL OUString(RTL_CONSTASCII_USTRINGPARAM("BindingURL"))
+const char* pEventAsciiNames[] =
+{
+"OnStartApp",
+"OnCloseApp",
+"OnCreate",
+"OnNew",
+"OnLoadFinished",
+"OnLoad",
+"OnPrepareUnload",
+"OnUnload",
+"OnSave",
+"OnSaveDone",
+"OnSaveFailed",
+"OnSaveAs",
+"OnSaveAsDone",
+"OnSaveAsFailed",
+"OnCopyTo",
+"OnCopyToDone",
+"OnCopyToFailed",
+"OnFocus",
+"OnUnfocus",
+"OnPrint",
+"OnViewCreated",
+"OnPrepareViewClosing",
+"OnViewClosed",
+"OnModifyChanged",
+"OnTitleChanged",
+"OnVisAreaChanged",
+"OnModeChanged",
+"OnStorageChanged"
+};
+
GlobalEventConfig_Impl::GlobalEventConfig_Impl()
: ConfigItem( ROOTNODE_EVENTS, CONFIG_MODE_IMMEDIATE_UPDATE )
{
// the supported event names
- m_supportedEvents.push_back(::rtl::OUString::createFromAscii("OnStartApp"));
- m_supportedEvents.push_back(::rtl::OUString::createFromAscii("OnCloseApp"));
- m_supportedEvents.push_back(::rtl::OUString::createFromAscii("OnNew"));
- m_supportedEvents.push_back(::rtl::OUString::createFromAscii("OnUnload"));
- m_supportedEvents.push_back(::rtl::OUString::createFromAscii("OnPrepareUnload"));
- m_supportedEvents.push_back(::rtl::OUString::createFromAscii("OnLoad"));
- m_supportedEvents.push_back(::rtl::OUString::createFromAscii("OnSave"));
- m_supportedEvents.push_back(::rtl::OUString::createFromAscii("OnSaveAs"));
- m_supportedEvents.push_back(::rtl::OUString::createFromAscii("OnSaveDone"));
- m_supportedEvents.push_back(::rtl::OUString::createFromAscii("OnSaveAsDone"));
- m_supportedEvents.push_back(::rtl::OUString::createFromAscii("OnFocus"));
- m_supportedEvents.push_back(::rtl::OUString::createFromAscii("OnUnfocus"));
- m_supportedEvents.push_back(::rtl::OUString::createFromAscii("OnPrint"));
- m_supportedEvents.push_back(::rtl::OUString::createFromAscii("OnModifyChanged"));
+ m_supportedEvents.push_back(::rtl::OUString::createFromAscii( pEventAsciiNames[STR_EVENT_STARTAPP] ) );
+ m_supportedEvents.push_back(::rtl::OUString::createFromAscii( pEventAsciiNames[STR_EVENT_CLOSEAPP] ) );
+ m_supportedEvents.push_back(::rtl::OUString::createFromAscii( pEventAsciiNames[STR_EVENT_DOCCREATED] ) );
+ m_supportedEvents.push_back(::rtl::OUString::createFromAscii( pEventAsciiNames[STR_EVENT_CREATEDOC] ) );
+ m_supportedEvents.push_back(::rtl::OUString::createFromAscii( pEventAsciiNames[STR_EVENT_LOADFINISHED] ) );
+ m_supportedEvents.push_back(::rtl::OUString::createFromAscii( pEventAsciiNames[STR_EVENT_OPENDOC] ) );
+ m_supportedEvents.push_back(::rtl::OUString::createFromAscii( pEventAsciiNames[STR_EVENT_PREPARECLOSEDOC] ) );
+ m_supportedEvents.push_back(::rtl::OUString::createFromAscii( pEventAsciiNames[STR_EVENT_CLOSEDOC] ) );
+ m_supportedEvents.push_back(::rtl::OUString::createFromAscii( pEventAsciiNames[STR_EVENT_SAVEDOC] ) );
+ m_supportedEvents.push_back(::rtl::OUString::createFromAscii( pEventAsciiNames[STR_EVENT_SAVEDOCDONE] ) );
+ m_supportedEvents.push_back(::rtl::OUString::createFromAscii( pEventAsciiNames[STR_EVENT_SAVEDOCFAILED] ) );
+ m_supportedEvents.push_back(::rtl::OUString::createFromAscii( pEventAsciiNames[STR_EVENT_SAVEASDOC] ) );
+ m_supportedEvents.push_back(::rtl::OUString::createFromAscii( pEventAsciiNames[STR_EVENT_SAVEASDOCDONE] ) );
+ m_supportedEvents.push_back(::rtl::OUString::createFromAscii( pEventAsciiNames[STR_EVENT_SAVEASDOCFAILED] ) );
+ m_supportedEvents.push_back(::rtl::OUString::createFromAscii( pEventAsciiNames[STR_EVENT_SAVETODOC] ) );
+ m_supportedEvents.push_back(::rtl::OUString::createFromAscii( pEventAsciiNames[STR_EVENT_SAVETODOCDONE] ) );
+ m_supportedEvents.push_back(::rtl::OUString::createFromAscii( pEventAsciiNames[STR_EVENT_SAVETODOCFAILED] ) );
+ m_supportedEvents.push_back(::rtl::OUString::createFromAscii( pEventAsciiNames[STR_EVENT_ACTIVATEDOC] ) );
+ m_supportedEvents.push_back(::rtl::OUString::createFromAscii( pEventAsciiNames[STR_EVENT_DEACTIVATEDOC] ) );
+ m_supportedEvents.push_back(::rtl::OUString::createFromAscii( pEventAsciiNames[STR_EVENT_PRINTDOC] ) );
+ m_supportedEvents.push_back(::rtl::OUString::createFromAscii( pEventAsciiNames[STR_EVENT_VIEWCREATED] ) );
+ m_supportedEvents.push_back(::rtl::OUString::createFromAscii( pEventAsciiNames[STR_EVENT_PREPARECLOSEVIEW] ) );
+ m_supportedEvents.push_back(::rtl::OUString::createFromAscii( pEventAsciiNames[STR_EVENT_CLOSEVIEW] ) );
+ m_supportedEvents.push_back(::rtl::OUString::createFromAscii( pEventAsciiNames[STR_EVENT_MODIFYCHANGED] ) );
+ m_supportedEvents.push_back(::rtl::OUString::createFromAscii( pEventAsciiNames[STR_EVENT_TITLECHANGED] ) );
+ m_supportedEvents.push_back(::rtl::OUString::createFromAscii( pEventAsciiNames[STR_EVENT_VISAREACHANGED] ) );
+ m_supportedEvents.push_back(::rtl::OUString::createFromAscii( pEventAsciiNames[STR_EVENT_MODECHANGED] ) );
+ m_supportedEvents.push_back(::rtl::OUString::createFromAscii( pEventAsciiNames[STR_EVENT_STORAGECHANGED] ) );
initBindingInfo();
@@ -103,6 +149,14 @@ GlobalEventConfig_Impl::~GlobalEventConfig_Impl()
}
}
+::rtl::OUString GlobalEventConfig_Impl::GetEventName( sal_Int32 nIndex )
+{
+ if ( nIndex < (sal_Int32) m_supportedEvents.size() )
+ return m_supportedEvents[nIndex];
+ else
+ return rtl::OUString();
+}
+
//*****************************************************************************************************************
// public method
//*****************************************************************************************************************
@@ -396,3 +450,9 @@ Mutex& GlobalEventConfig::GetOwnStaticMutex()
// Return new created or already existing mutex object.
return *pMutex;
}
+
+::rtl::OUString GlobalEventConfig::GetEventName( sal_Int32 nIndex )
+{
+ return GlobalEventConfig().m_pImpl->GetEventName( nIndex );
+}
+