diff options
author | Ashod Nakashian <ashod.nakashian@collabora.co.uk> | 2022-05-15 10:05:54 -0400 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2022-10-26 08:18:55 +0200 |
commit | 038c4a42834014b421a2e8a99ae436eb2dc8f8c5 (patch) | |
tree | 2e519361c64ef0e940b4788bdc6df6111069ea0d /include | |
parent | 110370baa621f33a095e1da908f89bdfb5a68ce6 (diff) |
lok: support embedded media
Change-Id: Ie8f3ed188cec0050a10a5d49325756931b902ef1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141807
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/LibreOfficeKit/LibreOfficeKitEnums.h | 19 | ||||
-rw-r--r-- | include/sfx2/lokhelper.hxx | 4 | ||||
-rw-r--r-- | include/svx/svdomedia.hxx | 3 |
3 files changed, 26 insertions, 0 deletions
diff --git a/include/LibreOfficeKit/LibreOfficeKitEnums.h b/include/LibreOfficeKit/LibreOfficeKitEnums.h index 3bc0ad940b18..1e9821204c0b 100644 --- a/include/LibreOfficeKit/LibreOfficeKitEnums.h +++ b/include/LibreOfficeKit/LibreOfficeKitEnums.h @@ -882,6 +882,23 @@ typedef enum * */ LOK_CALLBACK_FONTS_MISSING = 57, + + /** + * Insertion, removal, movement, and selection of a media shape. + * The payload is a json with the relevant details. + * + * { + * "action": "insert", + * "id": 123456, + * "url": "file:// ..." + * "x": ..., + * "y": ..., + * } + * + * where the "svg" property is a string containing an svg document + * which is a representation of the pie segment. + */ + LOK_CALLBACK_MEDIA_SHAPE = 58, } LibreOfficeKitCallbackType; @@ -1026,6 +1043,8 @@ static inline const char* lokCallbackTypeToString(int nType) return "LOK_CALLBACK_PRINT_RANGES"; case LOK_CALLBACK_FONTS_MISSING: return "LOK_CALLBACK_FONTS_MISSING"; + case LOK_CALLBACK_MEDIA_SHAPE: + return "LOK_CALLBACK_MEDIA_SHAPE"; } assert(!"Unknown LibreOfficeKitCallbackType type."); diff --git a/include/sfx2/lokhelper.hxx b/include/sfx2/lokhelper.hxx index 1c5a94966776..eaa7abe9785c 100644 --- a/include/sfx2/lokhelper.hxx +++ b/include/sfx2/lokhelper.hxx @@ -157,6 +157,10 @@ public: /// Helper for diagnosing run-time problems static void dumpState(rtl::OStringBuffer &rState); + /// Notify all views of a media update. + /// This could be a new insertion or property modifications to an existing one. + static void notifyMediaUpdate(boost::property_tree::ptree& json); + private: static int createView(SfxViewFrame* pViewFrame, ViewShellDocId docId); }; diff --git a/include/svx/svdomedia.hxx b/include/svx/svdomedia.hxx index 020f4d56c947..6199fcaffe5b 100644 --- a/include/svx/svdomedia.hxx +++ b/include/svx/svdomedia.hxx @@ -72,6 +72,9 @@ public: virtual bool shouldKeepAspectRatio() const override { return true; } + /// When Lokit is enabled, notify the media details. + void notifyPropertiesForLOKit(); + private: void mediaPropertiesChanged( const ::avmedia::MediaItem& rNewState ); virtual std::unique_ptr<sdr::contact::ViewContact> CreateObjectSpecificViewContact() override; |