diff options
author | Siqi Liu <me@siqi.fr> | 2015-04-13 16:23:32 +0200 |
---|---|---|
committer | Siqi Liu <me@siqi.fr> | 2015-04-13 16:23:32 +0200 |
commit | 0632f77ee8059f2d65ad72bf148da88901732dc2 (patch) | |
tree | 8717d2ebfc7af6b91499ec2c94792661122317bc /include | |
parent | cc54da22377feef44e1aa48a92d9b4c86eda7577 (diff) |
LOK_STATE_CHANGED callback implemented with sfx events interception.
Diffstat (limited to 'include')
-rw-r--r-- | include/LibreOfficeKit/LibreOfficeKitEnums.h | 9 | ||||
-rw-r--r-- | include/sfx2/objsh.hxx | 11 | ||||
-rw-r--r-- | include/sfx2/unoctitm.hxx | 2 |
3 files changed, 21 insertions, 1 deletions
diff --git a/include/LibreOfficeKit/LibreOfficeKitEnums.h b/include/LibreOfficeKit/LibreOfficeKitEnums.h index e8d2b59dec45..d4d1b4c4fc3b 100644 --- a/include/LibreOfficeKit/LibreOfficeKitEnums.h +++ b/include/LibreOfficeKit/LibreOfficeKitEnums.h @@ -102,7 +102,14 @@ typedef enum * User clicked on an hyperlink that should be handled by other * applications accordingly. */ - LOK_CALLBACK_HYPERLINK_CLICKED + LOK_CALLBACK_HYPERLINK_CLICKED, + + /** + * Emit state update to the client. + * For example, when cursor is on bold text, this callback is triggered + * with payload: ".uno:Bold=true" + */ + LOK_CALLBACK_STATE_CHANGED } LibreOfficeKitCallbackType; diff --git a/include/sfx2/objsh.hxx b/include/sfx2/objsh.hxx index 8b82d767e45a..7e235d99ef82 100644 --- a/include/sfx2/objsh.hxx +++ b/include/sfx2/objsh.hxx @@ -49,6 +49,9 @@ #include <set> #include <o3tl/typed_flags_set.hxx> +#define LOK_USE_UNSTABLE_API +#include <LibreOfficeKit/LibreOfficeKitTypes.h> + class SbxValue; class SvxMacro; class SbxArray; @@ -708,6 +711,14 @@ public: SAL_DLLPRIVATE void CancelCheckOut( ); SAL_DLLPRIVATE void CheckIn( ); SAL_DLLPRIVATE ::com::sun::star::uno::Sequence< ::com::sun::star::document::CmisVersion > GetCmisVersions(); + + /** + * Interface shared by document shell. Allow LOK calls from sfx. + * Default behavior doesn't do anything. relevant SfxObjectShells should override + * the default behavior and implements LOK calls. + */ + virtual void libreOfficeKitCallback(int nType, const char* pPayload) const; + virtual bool isTiledRendering() const; }; #define SFX_GLOBAL_CLASSID \ diff --git a/include/sfx2/unoctitm.hxx b/include/sfx2/unoctitm.hxx index 97d12dacf9fe..70122ee2d3d4 100644 --- a/include/sfx2/unoctitm.hxx +++ b/include/sfx2/unoctitm.hxx @@ -175,6 +175,8 @@ public: void UnBindController(); SfxDispatcher* GetDispatcher(); void SetFrame(const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& xFrame); + + void InterceptLOKStateChangeEvent(const SfxObjectShell* objSh, const ::com::sun::star::frame::FeatureStateEvent& aEvent) const; }; #endif |