diff options
author | Pranav Kant <pranavk@collabora.co.uk> | 2017-12-01 13:54:45 +0530 |
---|---|---|
committer | Pranav Kant <pranavk@collabora.co.uk> | 2017-12-04 17:14:02 +0530 |
commit | b5e27fd809845577a90cc1811de062c070110078 (patch) | |
tree | 679cb1c3712b6b0a5b693dfa9990e6de8592cc62 /include | |
parent | 3d8154ec427777eadf5719f194662e5ade78fae5 (diff) |
lokdialog: Simplify; make the LOK dialog API more generic
Merge the dialog floating window callbacks and function calls into one.
Unique window ids across vcl::Window is enough to distinguish between
them.
Floating windows don't have a LOK notifier as they are created in the
vcl itself (so we can't access them from sfx2). Use the parent LOK
notifier in that case (which would be a dialog).
This API should also help in autopopup filter tunneling later.
Change-Id: I63a2c97ffdd84695dc967e14c793089a7c50b41b
Diffstat (limited to 'include')
-rw-r--r-- | include/LibreOfficeKit/LibreOfficeKit.h | 3 | ||||
-rw-r--r-- | include/LibreOfficeKit/LibreOfficeKit.hxx | 19 | ||||
-rw-r--r-- | include/LibreOfficeKit/LibreOfficeKitEnums.h | 21 | ||||
-rw-r--r-- | include/sfx2/lokhelper.hxx | 6 | ||||
-rw-r--r-- | include/sfx2/viewsh.hxx | 1 | ||||
-rw-r--r-- | include/vcl/IDialogRenderable.hxx | 2 | ||||
-rw-r--r-- | include/vcl/dialog.hxx | 2 | ||||
-rw-r--r-- | include/vcl/floatwin.hxx | 2 | ||||
-rw-r--r-- | include/vcl/window.hxx | 1 |
9 files changed, 5 insertions, 52 deletions
diff --git a/include/LibreOfficeKit/LibreOfficeKit.h b/include/LibreOfficeKit/LibreOfficeKit.h index 350dd03dbc5f..d25031cd9f32 100644 --- a/include/LibreOfficeKit/LibreOfficeKit.h +++ b/include/LibreOfficeKit/LibreOfficeKit.h @@ -277,9 +277,6 @@ struct _LibreOfficeKitDocumentClass const int x, const int y, const int width, const int height); - /// @see lok::Document::paintActiveFloatingWindow(). - void (*paintActiveFloatingWindow) (LibreOfficeKitDocument* pThis, unsigned nDialogId, unsigned char* pBuffer, int* nWidth, int* nHeight); - /// @see lok::Document::postWindow(). void (*postWindow) (LibreOfficeKitDocument* pThis, unsigned nWindowId, int nAction); diff --git a/include/LibreOfficeKit/LibreOfficeKit.hxx b/include/LibreOfficeKit/LibreOfficeKit.hxx index 3c1d27b48d49..ee82fdb31e20 100644 --- a/include/LibreOfficeKit/LibreOfficeKit.hxx +++ b/include/LibreOfficeKit/LibreOfficeKit.hxx @@ -177,25 +177,6 @@ public: } /** - * Renders the active floating window of a dialog - * - * Client must truncate pBuffer according to the nWidth and nHeight returned after the call. - * - * @param nDialogId Unique dialog id - * @param pBuffer Buffer with enough memory allocated to render any dialog - * @param nWidth output parameter returning the width of the rendered dialog. - * @param nHeight output parameter returning the height of the rendered dialog - */ - void paintActiveFloatingWindow(unsigned nDialogId, - unsigned char* pBuffer, - int& nWidth, - int& nHeight) - { - return mpDoc->pClass->paintActiveFloatingWindow(mpDoc, nDialogId, pBuffer, - &nWidth, &nHeight); - } - - /** * Posts a command to the window (dialog, popup, etc.) with given id * * @param nWindowid diff --git a/include/LibreOfficeKit/LibreOfficeKitEnums.h b/include/LibreOfficeKit/LibreOfficeKitEnums.h index facbd351633d..cf85d7c6b592 100644 --- a/include/LibreOfficeKit/LibreOfficeKitEnums.h +++ b/include/LibreOfficeKit/LibreOfficeKitEnums.h @@ -531,26 +531,7 @@ typedef enum /** * Dialog invalidation */ - LOK_CALLBACK_DIALOG = 36, - - /** - * Invalidation corresponding to dialog's children. - * Eg: Floating window etc. - * - * Payload example: - * { - * "dialogID": "SpellDialog", - * "action": "close" - * } - * - * - dialogID is the UNO command of the dialog - * - action can be - * - close, means dialog child window is closed now - * - invalidate, means dialog child window is invalidated - * It also means that dialog child window is created if it's the first - * invalidate - */ - LOK_CALLBACK_DIALOG_CHILD = 37 + LOK_CALLBACK_WINDOW = 36, } LibreOfficeKitCallbackType; diff --git a/include/sfx2/lokhelper.hxx b/include/sfx2/lokhelper.hxx index 00288d04faac..f342b502e810 100644 --- a/include/sfx2/lokhelper.hxx +++ b/include/sfx2/lokhelper.hxx @@ -41,12 +41,10 @@ public: static void notifyOtherViews(SfxViewShell* pThisView, int nType, const OString& rKey, const OString& rPayload); /// Same as notifyOtherViews(), but works on a selected "other" view, not on all of them. static void notifyOtherView(SfxViewShell* pThisView, SfxViewShell const* pOtherView, int nType, const OString& rKey, const OString& rPayload); - /// Emits a LOK_CALLBACK_DIALOG - static void notifyWindow(vcl::LOKWindowId nDialogId, + /// Emits a LOK_CALLBACK_WINDOW + static void notifyWindow(vcl::LOKWindowId nWindowId, const OUString& rAction, const std::vector<vcl::LOKPayloadItem>& rPayload = std::vector<vcl::LOKPayloadItem>()); - /// Emits a LOK_CALLBACK_DIALOG_CHILD - static void notifyWindowChild(vcl::LOKWindowId nDialogId, const OUString& rAction, const Point& rPos); /// Emits a LOK_CALLBACK_INVALIDATE_TILES, but tweaks it according to setOptionalFeatures() if needed. static void notifyInvalidation(SfxViewShell const* pThisView, const OString& rPayload); /// A special value to signify 'infinity'. diff --git a/include/sfx2/viewsh.hxx b/include/sfx2/viewsh.hxx index 90ade4ba1463..988e1d3490ec 100644 --- a/include/sfx2/viewsh.hxx +++ b/include/sfx2/viewsh.hxx @@ -223,7 +223,6 @@ public: // ILibreOfficeKitNotifier virtual void notifyWindow(vcl::LOKWindowId nLOKWindowId, const OUString& rAction, const std::vector<vcl::LOKPayloadItem>& rPayload = std::vector<vcl::LOKPayloadItem>()) const override; - virtual void notifyWindowChild(vcl::LOKWindowId nLOKWindowId, const OUString& rAction, const Point& rPos) const override; // Focus, KeyInput, Cursor virtual void ShowCursor( bool bOn = true ); diff --git a/include/vcl/IDialogRenderable.hxx b/include/vcl/IDialogRenderable.hxx index 281d04385aee..ef8d42a4a46c 100644 --- a/include/vcl/IDialogRenderable.hxx +++ b/include/vcl/IDialogRenderable.hxx @@ -34,8 +34,6 @@ public: virtual void notifyWindow(vcl::LOKWindowId nLOKWindowId, const OUString& rAction, const std::vector<LOKPayloadItem>& rPayload = std::vector<LOKPayloadItem>()) const = 0; - - virtual void notifyWindowChild(vcl::LOKWindowId nLOKWindowId, const OUString& rAction, const Point& rPos) const = 0; }; } // namespace vcl diff --git a/include/vcl/dialog.hxx b/include/vcl/dialog.hxx index f8c58122396d..3da4ec0cb59a 100644 --- a/include/vcl/dialog.hxx +++ b/include/vcl/dialog.hxx @@ -75,8 +75,6 @@ protected: public: SAL_DLLPRIVATE bool IsInClose() const { return mbInClose; } virtual void doDeferredInit(WinBits nBits) override; - void InvalidateFloatingWindow(const Point& rPos); - void CloseFloatingWindow(); protected: explicit Dialog( WindowType nType ); diff --git a/include/vcl/floatwin.hxx b/include/vcl/floatwin.hxx index f0faa3c3e260..6ebb5c84cf37 100644 --- a/include/vcl/floatwin.hxx +++ b/include/vcl/floatwin.hxx @@ -129,7 +129,7 @@ public: SAL_DLLPRIVATE tools::Rectangle& ImplGetItemEdgeClipRect(); SAL_DLLPRIVATE bool ImplIsInPrivatePopupMode() const { return mbInPopupMode; } virtual void doDeferredInit(WinBits nBits) override; - virtual void LogicInvalidate(const tools::Rectangle* pRectangle) override; + void LogicInvalidate(const tools::Rectangle* pRectangle) override; public: explicit FloatingWindow(vcl::Window* pParent, WinBits nStyle); diff --git a/include/vcl/window.hxx b/include/vcl/window.hxx index 603e7307291f..f7c4e6e09dfd 100644 --- a/include/vcl/window.hxx +++ b/include/vcl/window.hxx @@ -1207,6 +1207,7 @@ public: void SetLOKNotifier(const vcl::ILibreOfficeKitNotifier* pNotifier); const vcl::ILibreOfficeKitNotifier* GetLOKNotifier() const; vcl::LOKWindowId GetLOKWindowId() const; + vcl::Window* GetParentWithLOKNotifier(); /// Indicate that LOK is not going to use this dialog any more. void ReleaseLOKNotifier(); |