| OLD | NEW |
| (Empty) |
| 1 // Copyright 2014 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 FPDFSDK_INCLUDE_FX_SYSTEMHANDLER_H_ | |
| 8 #define FPDFSDK_INCLUDE_FX_SYSTEMHANDLER_H_ | |
| 9 | |
| 10 #include "core/fxcrt/include/fx_coordinates.h" | |
| 11 #include "core/fxcrt/include/fx_system.h" | |
| 12 | |
| 13 class CPDF_Document; | |
| 14 class CPDF_Font; | |
| 15 | |
| 16 typedef void* FX_HWND; | |
| 17 typedef void* FX_HMENU; | |
| 18 typedef void (*TimerCallback)(int32_t idEvent); | |
| 19 | |
| 20 struct FX_SYSTEMTIME { | |
| 21 FX_SYSTEMTIME() | |
| 22 : wYear(0), | |
| 23 wMonth(0), | |
| 24 wDayOfWeek(0), | |
| 25 wDay(0), | |
| 26 wHour(0), | |
| 27 wMinute(0), | |
| 28 wSecond(0), | |
| 29 wMilliseconds(0) {} | |
| 30 uint16_t wYear; | |
| 31 uint16_t wMonth; | |
| 32 uint16_t wDayOfWeek; | |
| 33 uint16_t wDay; | |
| 34 uint16_t wHour; | |
| 35 uint16_t wMinute; | |
| 36 uint16_t wSecond; | |
| 37 uint16_t wMilliseconds; | |
| 38 }; | |
| 39 | |
| 40 // cursor style | |
| 41 #define FXCT_ARROW 0 | |
| 42 #define FXCT_NESW 1 | |
| 43 #define FXCT_NWSE 2 | |
| 44 #define FXCT_VBEAM 3 | |
| 45 #define FXCT_HBEAM 4 | |
| 46 #define FXCT_HAND 5 | |
| 47 | |
| 48 class IFX_SystemHandler { | |
| 49 public: | |
| 50 virtual ~IFX_SystemHandler() {} | |
| 51 virtual void InvalidateRect(FX_HWND hWnd, FX_RECT rect) = 0; | |
| 52 virtual void OutputSelectedRect(void* pFormFiller, CFX_FloatRect& rect) = 0; | |
| 53 | |
| 54 virtual FX_BOOL IsSelectionImplemented() = 0; | |
| 55 | |
| 56 virtual CFX_WideString GetClipboardText(FX_HWND hWnd) = 0; | |
| 57 virtual FX_BOOL SetClipboardText(FX_HWND hWnd, CFX_WideString str) = 0; | |
| 58 | |
| 59 virtual void ClientToScreen(FX_HWND hWnd, int32_t& x, int32_t& y) = 0; | |
| 60 virtual void ScreenToClient(FX_HWND hWnd, int32_t& x, int32_t& y) = 0; | |
| 61 | |
| 62 /*cursor style | |
| 63 FXCT_ARROW | |
| 64 FXCT_NESW | |
| 65 FXCT_NWSE | |
| 66 FXCT_VBEAM | |
| 67 FXCT_HBEAM | |
| 68 FXCT_HAND | |
| 69 */ | |
| 70 virtual void SetCursor(int32_t nCursorType) = 0; | |
| 71 | |
| 72 virtual FX_HMENU CreatePopupMenu() = 0; | |
| 73 virtual FX_BOOL AppendMenuItem(FX_HMENU hMenu, | |
| 74 int32_t nIDNewItem, | |
| 75 CFX_WideString str) = 0; | |
| 76 virtual FX_BOOL EnableMenuItem(FX_HMENU hMenu, | |
| 77 int32_t nIDItem, | |
| 78 FX_BOOL bEnabled) = 0; | |
| 79 virtual int32_t TrackPopupMenu(FX_HMENU hMenu, | |
| 80 int32_t x, | |
| 81 int32_t y, | |
| 82 FX_HWND hParent) = 0; | |
| 83 virtual void DestroyMenu(FX_HMENU hMenu) = 0; | |
| 84 | |
| 85 virtual CFX_ByteString GetNativeTrueTypeFont(int32_t nCharset) = 0; | |
| 86 virtual FX_BOOL FindNativeTrueTypeFont(int32_t nCharset, | |
| 87 CFX_ByteString sFontFaceName) = 0; | |
| 88 virtual CPDF_Font* AddNativeTrueTypeFontToPDF(CPDF_Document* pDoc, | |
| 89 CFX_ByteString sFontFaceName, | |
| 90 uint8_t nCharset) = 0; | |
| 91 | |
| 92 virtual int32_t SetTimer(int32_t uElapse, TimerCallback lpTimerFunc) = 0; | |
| 93 virtual void KillTimer(int32_t nID) = 0; | |
| 94 | |
| 95 virtual FX_BOOL IsSHIFTKeyDown(uint32_t nFlag) = 0; | |
| 96 virtual FX_BOOL IsCTRLKeyDown(uint32_t nFlag) = 0; | |
| 97 virtual FX_BOOL IsALTKeyDown(uint32_t nFlag) = 0; | |
| 98 virtual FX_BOOL IsINSERTKeyDown(uint32_t nFlag) = 0; | |
| 99 | |
| 100 virtual FX_SYSTEMTIME GetLocalTime() = 0; | |
| 101 | |
| 102 virtual int32_t GetCharSet() = 0; | |
| 103 virtual void SetCharSet(int32_t nCharSet) = 0; | |
| 104 }; | |
| 105 | |
| 106 #endif // FPDFSDK_INCLUDE_FX_SYSTEMHANDLER_H_ | |
| OLD | NEW |