OLD | NEW |
(Empty) | |
| 1 // Copyright 2016 PDFium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
| 6 |
| 7 #ifndef XFA_FWL_CORE_IFWL_NOTEDRIVER_H_ |
| 8 #define XFA_FWL_CORE_IFWL_NOTEDRIVER_H_ |
| 9 |
| 10 #include "core/fxcrt/include/fx_system.h" |
| 11 #include "xfa/fwl/core/cfwl_event.h" |
| 12 #include "xfa/fwl/core/fwl_error.h" |
| 13 |
| 14 #define FWL_KEYFLAG_Ctrl (1 << 0) |
| 15 #define FWL_KEYFLAG_Alt (1 << 1) |
| 16 #define FWL_KEYFLAG_Shift (1 << 2) |
| 17 #define FWL_KEYFLAG_Command (1 << 3) |
| 18 #define FWL_KEYFLAG_LButton (1 << 4) |
| 19 #define FWL_KEYFLAG_RButton (1 << 5) |
| 20 #define FWL_KEYFLAG_MButton (1 << 6) |
| 21 |
| 22 class CFWL_Message; |
| 23 class CFWL_Note; |
| 24 class IFWL_NoteLoop; |
| 25 class IFWL_NoteThread; |
| 26 class IFWL_Widget; |
| 27 |
| 28 class IFWL_NoteDriver { |
| 29 public: |
| 30 virtual ~IFWL_NoteDriver() {} |
| 31 |
| 32 virtual FX_BOOL SendNote(CFWL_Note* pNote) = 0; |
| 33 virtual FX_BOOL PostMessage(CFWL_Message* pMessage) = 0; |
| 34 virtual FWL_ERR RegisterEventTarget( |
| 35 IFWL_Widget* pListener, |
| 36 IFWL_Widget* pEventSource = NULL, |
| 37 FX_DWORD dwFilter = FWL_EVENT_ALL_MASK) = 0; |
| 38 virtual FWL_ERR UnregisterEventTarget(IFWL_Widget* pListener) = 0; |
| 39 virtual void ClearEventTargets(FX_BOOL bRemoveAll) = 0; |
| 40 virtual int32_t GetQueueMaxSize() const = 0; |
| 41 virtual FWL_ERR SetQueueMaxSize(const int32_t size) = 0; |
| 42 virtual IFWL_NoteThread* GetOwnerThread() const = 0; |
| 43 virtual FWL_ERR PushNoteLoop(IFWL_NoteLoop* pNoteLoop) = 0; |
| 44 virtual IFWL_NoteLoop* PopNoteLoop() = 0; |
| 45 virtual IFWL_Widget* GetFocus() = 0; |
| 46 virtual FX_BOOL SetFocus(IFWL_Widget* pFocus, FX_BOOL bNotify = FALSE) = 0; |
| 47 virtual void SetGrab(IFWL_Widget* pGrab, FX_BOOL bSet) = 0; |
| 48 virtual FWL_ERR Run() = 0; |
| 49 }; |
| 50 |
| 51 IFWL_Widget* FWL_GetCurrentThreadModalWidget(IFWL_NoteThread* pNoteThread); |
| 52 |
| 53 typedef FX_BOOL (*FWLMessageHookCallback)(CFWL_Message* msg, void* info); |
| 54 FWL_ERR FWL_SetHook(IFWL_NoteDriver* driver, |
| 55 FWLMessageHookCallback callback, |
| 56 void* info); |
| 57 |
| 58 #endif // XFA_FWL_CORE_IFWL_NOTEDRIVER_H_ |
OLD | NEW |