summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorJan Holesovsky <kendy@collabora.com>2017-11-24 10:20:47 +0100
committerJan Holesovsky <kendy@collabora.com>2017-11-28 17:59:13 +0100
commit9df590be66324884e3e0e4eb9b255cd35103b06b (patch)
tree7b75e4d75eb11cd09b57cc8656129c22ddd430eb /include
parentf003eba0e30f41d036bed6fe417520fe66a3335f (diff)
lokdialog: Move the Notifier down to vcl::Window.
We need to tunnel more than just dialogs, so this is the 1st step to get the Autofilter popup rendered. Change-Id: I6523a39ddc7a6eb2a204e48ab364130a5822f548
Diffstat (limited to 'include')
-rw-r--r--include/sfx2/lokhelper.hxx4
-rw-r--r--include/sfx2/viewsh.hxx16
-rw-r--r--include/vcl/IDialogRenderable.hxx24
-rw-r--r--include/vcl/dialog.hxx8
-rw-r--r--include/vcl/window.hxx8
5 files changed, 29 insertions, 31 deletions
diff --git a/include/sfx2/lokhelper.hxx b/include/sfx2/lokhelper.hxx
index ce0a69b75e6f..c199a5287b5c 100644
--- a/include/sfx2/lokhelper.hxx
+++ b/include/sfx2/lokhelper.hxx
@@ -42,11 +42,11 @@ public:
/// Same as notifyOtherViews(), but works on a selected "other" view, not on all of them.
static void notifyOtherView(SfxViewShell* pThisView, SfxViewShell* pOtherView, int nType, const OString& rKey, const OString& rPayload);
/// Emits a LOK_CALLBACK_DIALOG
- static void notifyDialog(vcl::DialogID nDialogId,
+ static void notifyDialog(vcl::LOKWindowId nDialogId,
const OUString& rAction,
const std::vector<vcl::LOKPayloadItem>& rPayload = std::vector<vcl::LOKPayloadItem>());
/// Emits a LOK_CALLBACK_DIALOG_CHILD
- static void notifyDialogChild(vcl::DialogID nDialogId, const OUString& rAction, const Point& rPos);
+ static void notifyDialogChild(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* pThisView, const OString& rPayload);
/// A special value to signify 'infinity'.
diff --git a/include/sfx2/viewsh.hxx b/include/sfx2/viewsh.hxx
index 0db8fb3aec82..7602da3f5d25 100644
--- a/include/sfx2/viewsh.hxx
+++ b/include/sfx2/viewsh.hxx
@@ -143,7 +143,7 @@ template<class T> bool checkSfxViewShell(const SfxViewShell* pShell)
return dynamic_cast<const T*>(pShell) != nullptr;
}
-class SFX2_DLLPUBLIC SfxViewShell: public SfxShell, public SfxListener, public OutlinerViewShell, public vcl::IDialogNotifier
+class SFX2_DLLPUBLIC SfxViewShell: public SfxShell, public SfxListener, public OutlinerViewShell, public vcl::ILibreOfficeKitNotifier
{
#ifdef INCLUDED_SFX2_VIEWSH_HXX
friend class SfxViewFrame;
@@ -157,7 +157,7 @@ friend class SfxPrinterController;
VclPtr<vcl::Window> pWindow;
bool bNoNewWindow;
bool mbPrinterSettingsModified;
- std::vector<std::pair<vcl::DialogID, VclPtr<Dialog> > > maOpenedDialogs;
+ std::vector<std::pair<vcl::LOKWindowId, VclPtr<Dialog> > > maOpenedDialogs;
protected:
virtual void Activate(bool IsMDIActivate) override;
@@ -227,13 +227,13 @@ public:
virtual SfxShell* GetFormShell() { return nullptr; };
virtual const SfxShell* GetFormShell() const { return nullptr; };
- void RegisterDlg(vcl::DialogID nDialogId, VclPtr<Dialog> pDlg);
- VclPtr<Dialog> GetOpenedDlg(vcl::DialogID nDialogId);
- void UnregisterDlg(vcl::DialogID nDialogId);
+ void RegisterDlg(vcl::LOKWindowId nDialogId, VclPtr<Dialog> pDlg);
+ VclPtr<Dialog> GetOpenedDlg(vcl::LOKWindowId nDialogId);
+ void UnregisterDlg(vcl::LOKWindowId nDialogId);
- // IDialogNotifier
- virtual void notifyDialog(const vcl::DialogID& rDialogId, const OUString& rAction, const std::vector<vcl::LOKPayloadItem>& rPayload = std::vector<vcl::LOKPayloadItem>()) override;
- virtual void notifyDialogChild(const vcl::DialogID& rDialogId, const OUString& rAction, const Point& rPos) override;
+ // ILibreOfficeKitNotifier
+ virtual void notifyDialog(const vcl::LOKWindowId& rDialogId, const OUString& rAction, const std::vector<vcl::LOKPayloadItem>& rPayload = std::vector<vcl::LOKPayloadItem>()) const override;
+ virtual void notifyDialogChild(const vcl::LOKWindowId& rDialogId, 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 ccb99cb0adb2..db3831ccd5c6 100644
--- a/include/vcl/IDialogRenderable.hxx
+++ b/include/vcl/IDialogRenderable.hxx
@@ -25,41 +25,39 @@ namespace vcl
typedef std::pair<const OString, const OString> LOKPayloadItem;
-typedef sal_uInt32 DialogID;
-
class VCL_DLLPUBLIC IDialogRenderable
{
public:
virtual ~IDialogRenderable();
- virtual void paintDialog(const DialogID& rDialogID, VirtualDevice &rDevice) = 0;
+ virtual void paintDialog(const LOKWindowId& rLOKWindowId, VirtualDevice &rDevice) = 0;
- virtual void getDialogInfo(const DialogID& rDialogID, OUString& rDialogTitle, int& rWidth, int& rHeight) = 0;
+ virtual void getDialogInfo(const LOKWindowId& rLOKWindowId, OUString& rDialogTitle, int& rWidth, int& rHeight) = 0;
- virtual void paintActiveFloatingWindow(const DialogID& rDialogID, VirtualDevice &rDevice,
+ virtual void paintActiveFloatingWindow(const LOKWindowId& rLOKWindowId, VirtualDevice &rDevice,
int& nOutputWidth, int& nOutputHeight) = 0;
- virtual void postDialogKeyEvent(const DialogID& rDialogID, int nType,
+ virtual void postDialogKeyEvent(const LOKWindowId& rLOKWindowId, int nType,
int nCharCode, int nKeyCode) = 0;
- virtual void postDialogMouseEvent(const DialogID& rDialogID, int nType, int nX, int nY,
+ virtual void postDialogMouseEvent(const LOKWindowId& rLOKWindowId, int nType, int nX, int nY,
int nCount, int nButtons, int nModifier) = 0;
- virtual void postDialogChildMouseEvent(const DialogID& rDialogID, int nType, int nX, int nY,
+ virtual void postDialogChildMouseEvent(const LOKWindowId& rLOKWindowId, int nType, int nX, int nY,
int nCount, int nButtons, int nModifier) = 0;
};
-class VCL_DLLPUBLIC IDialogNotifier
+class VCL_DLLPUBLIC ILibreOfficeKitNotifier
{
public:
- virtual ~IDialogNotifier() {}
+ virtual ~ILibreOfficeKitNotifier() {}
// Callbacks
- virtual void notifyDialog(const DialogID& rDialogID,
+ virtual void notifyDialog(const LOKWindowId& rLOKWindowId,
const OUString& rAction,
- const std::vector<LOKPayloadItem>& rPayload = std::vector<LOKPayloadItem>()) = 0;
+ const std::vector<LOKPayloadItem>& rPayload = std::vector<LOKPayloadItem>()) const = 0;
- virtual void notifyDialogChild(const DialogID& rDialogID, const OUString& rAction, const Point& rPos) = 0;
+ virtual void notifyDialogChild(const LOKWindowId& rLOKWindowId, const OUString& rAction, const Point& rPos) const = 0;
};
} // namespace vcl
diff --git a/include/vcl/dialog.hxx b/include/vcl/dialog.hxx
index 3586c116b31d..76952b2f3cc5 100644
--- a/include/vcl/dialog.hxx
+++ b/include/vcl/dialog.hxx
@@ -48,10 +48,6 @@ private:
VclPtr<VclButtonBox> mpActionArea;
VclPtr<VclBox> mpContentArea;
- vcl::IDialogNotifier* mpDialogNotifier; // to emit LOK callbacks
-
- static vcl::DialogID mnLastDialogId;
-
SAL_DLLPRIVATE void ImplInitDialogData();
SAL_DLLPRIVATE void ImplInitSettings();
@@ -65,10 +61,6 @@ private:
protected:
using Window::ImplInit;
SAL_DLLPRIVATE void ImplInit( vcl::Window* pParent, WinBits nStyle, InitFlag eFlag = InitFlag::Default );
- /// Dialog ID (used for LOK)
- vcl::DialogID maID;
- /// Necessary to register dialog notifier instance to emit LOK callbacks
- void registerDialogNotifier(vcl::IDialogNotifier* pDialogNotifier);
public:
SAL_DLLPRIVATE bool IsInClose() const { return mbInClose; }
diff --git a/include/vcl/window.hxx b/include/vcl/window.hxx
index 496a0743562c..08faef8e8519 100644
--- a/include/vcl/window.hxx
+++ b/include/vcl/window.hxx
@@ -435,6 +435,7 @@ const char* ImplDbgCheckWindow( const void* pObj );
namespace vcl { class Window; }
namespace vcl { class Cursor; }
+namespace vcl { class ILibreOfficeKitNotifier; }
class Dialog;
class WindowImpl;
class PaintHelper;
@@ -484,6 +485,8 @@ public:
Color* pPaintColor = nullptr);
};
+typedef sal_uInt32 LOKWindowId;
+
class VCL_DLLPUBLIC Window : public ::OutputDevice, public Resource
{
friend class ::vcl::Cursor;
@@ -1200,6 +1203,11 @@ public:
void SetComponentInterface( css::uno::Reference< css::awt::XWindowPeer > const & xIFace );
+ /// Interface to register for dialog tunneling.
+ void SetLOKNotifier(const vcl::ILibreOfficeKitNotifier* pNotifier);
+ const vcl::ILibreOfficeKitNotifier* GetLOKNotifier() const;
+ vcl::LOKWindowId GetLOKWindowId() const;
+
/** @name Accessibility
*/
///@{