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.
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
7 #ifndef FPDFSDK_INCLUDE_FX_SYSTEMHANDLER_H_
8 #define FPDFSDK_INCLUDE_FX_SYSTEMHANDLER_H_
10 typedef void* FX_HWND;
11 typedef void* FX_HMENU;
12 typedef void (*TimerCallback)(int32_t idEvent);
14 typedef struct _FX_SYSTEMTIME {
31 FX_WORD wMilliseconds;
42 class IFX_SystemHandler {
44 virtual ~IFX_SystemHandler() {}
45 virtual void InvalidateRect(FX_HWND hWnd, FX_RECT rect) = 0;
46 virtual void OutputSelectedRect(void* pFormFiller, CPDF_Rect& rect) = 0;
48 virtual FX_BOOL IsSelectionImplemented() = 0;
50 virtual CFX_WideString GetClipboardText(FX_HWND hWnd) = 0;
51 virtual FX_BOOL SetClipboardText(FX_HWND hWnd, CFX_WideString string) = 0;
53 virtual void ClientToScreen(FX_HWND hWnd, int32_t& x, int32_t& y) = 0;
54 virtual void ScreenToClient(FX_HWND hWnd, int32_t& x, int32_t& y) = 0;
64 virtual void SetCursor(int32_t nCursorType) = 0;
66 virtual FX_HMENU CreatePopupMenu() = 0;
67 virtual FX_BOOL AppendMenuItem(FX_HMENU hMenu,
69 CFX_WideString string) = 0;
70 virtual FX_BOOL EnableMenuItem(FX_HMENU hMenu,
72 FX_BOOL bEnabled) = 0;
73 virtual int32_t TrackPopupMenu(FX_HMENU hMenu,
77 virtual void DestroyMenu(FX_HMENU hMenu) = 0;
79 virtual CFX_ByteString GetNativeTrueTypeFont(int32_t nCharset) = 0;
80 virtual FX_BOOL FindNativeTrueTypeFont(int32_t nCharset,
81 CFX_ByteString sFontFaceName) = 0;
82 virtual CPDF_Font* AddNativeTrueTypeFontToPDF(CPDF_Document* pDoc,
83 CFX_ByteString sFontFaceName,
84 uint8_t nCharset) = 0;
86 virtual int32_t SetTimer(int32_t uElapse, TimerCallback lpTimerFunc) = 0;
87 virtual void KillTimer(int32_t nID) = 0;
89 virtual FX_BOOL IsSHIFTKeyDown(FX_DWORD nFlag) = 0;
90 virtual FX_BOOL IsCTRLKeyDown(FX_DWORD nFlag) = 0;
91 virtual FX_BOOL IsALTKeyDown(FX_DWORD nFlag) = 0;
92 virtual FX_BOOL IsINSERTKeyDown(FX_DWORD nFlag) = 0;
94 virtual FX_SYSTEMTIME GetLocalTime() = 0;
96 virtual int32_t GetCharSet() = 0;
97 virtual void SetCharSet(int32_t nCharSet) = 0;
100 #endif // FPDFSDK_INCLUDE_FX_SYSTEMHANDLER_H_