Initial commit.
[pdfium.git] / fpdfsdk / include / fx_systemhandler.h
1 // Copyright 2014 PDFium Authors. All rights reserved.\r
2 // Use of this source code is governed by a BSD-style license that can be\r
3 // found in the LICENSE file.\r
4  \r
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com\r
6 \r
7 #ifndef _FX_SYSTEMHANDLER_H_\r
8 #define _FX_SYSTEMHANDLER_H_\r
9 \r
10 typedef FX_LPVOID                               FX_HWND;\r
11 typedef FX_LPVOID                               FX_HMENU;\r
12 typedef void                                    (*TimerCallback)(FX_INT32 idEvent);\r
13 \r
14 typedef struct _FX_SYSTEMTIME \r
15 {\r
16     FX_WORD wYear;\r
17     FX_WORD wMonth;\r
18     FX_WORD wDayOfWeek;\r
19     FX_WORD wDay;\r
20     FX_WORD wHour;\r
21     FX_WORD wMinute;\r
22     FX_WORD wSecond;\r
23     FX_WORD wMilliseconds;\r
24 }FX_SYSTEMTIME;\r
25 \r
26 //cursor style\r
27 #define FXCT_ARROW                              0\r
28 #define FXCT_NESW                               1\r
29 #define FXCT_NWSE                               2\r
30 #define FXCT_VBEAM                              3\r
31 #define FXCT_HBEAM                              4\r
32 #define FXCT_HAND                               5\r
33 \r
34 class IFX_SystemHandler\r
35 {\r
36 public:\r
37         virtual ~IFX_SystemHandler() {}\r
38         virtual void                            InvalidateRect(FX_HWND hWnd, FX_RECT rect) = 0;\r
39     virtual void                                OutputSelectedRect(void* pFormFiller, CPDF_Rect&rect) = 0;\r
40 \r
41         virtual FX_BOOL                         IsSelectionImplemented() = 0;\r
42 \r
43         virtual CFX_WideString          GetClipboardText(FX_HWND hWnd) = 0;\r
44         virtual FX_BOOL                         SetClipboardText(FX_HWND hWnd, CFX_WideString string) = 0;\r
45         \r
46         virtual void                            ClientToScreen(FX_HWND hWnd, FX_INT32& x, FX_INT32& y) = 0;\r
47         virtual void                            ScreenToClient(FX_HWND hWnd, FX_INT32& x, FX_INT32& y) = 0;\r
48 \r
49         /*cursor style\r
50         FXCT_ARROW      \r
51         FXCT_NESW               \r
52         FXCT_NWSE               \r
53         FXCT_VBEAM              \r
54         FXCT_HBEAM              \r
55         FXCT_HAND\r
56         */\r
57         virtual void                            SetCursor(FX_INT32 nCursorType) = 0;\r
58 \r
59         virtual FX_HMENU                        CreatePopupMenu() = 0;\r
60         virtual FX_BOOL                         AppendMenuItem(FX_HMENU hMenu, FX_INT32 nIDNewItem, CFX_WideString string) = 0;\r
61         virtual FX_BOOL                         EnableMenuItem(FX_HMENU hMenu, FX_INT32 nIDItem, FX_BOOL bEnabled) = 0;\r
62         virtual FX_INT32                        TrackPopupMenu(FX_HMENU hMenu, FX_INT32 x, FX_INT32 y, FX_HWND hParent) = 0;\r
63         virtual void                            DestroyMenu(FX_HMENU hMenu) = 0;\r
64 \r
65         virtual CFX_ByteString          GetNativeTrueTypeFont(FX_INT32 nCharset) = 0;\r
66         virtual FX_BOOL                         FindNativeTrueTypeFont(FX_INT32 nCharset, CFX_ByteString sFontFaceName) = 0;\r
67         virtual CPDF_Font*                      AddNativeTrueTypeFontToPDF(CPDF_Document* pDoc, CFX_ByteString sFontFaceName, FX_BYTE nCharset) = 0;\r
68 \r
69         virtual FX_INT32                        SetTimer(FX_INT32 uElapse, TimerCallback lpTimerFunc) = 0;\r
70         virtual void                            KillTimer(FX_INT32 nID) = 0;\r
71 \r
72 \r
73         virtual FX_BOOL                         IsSHIFTKeyDown(FX_DWORD nFlag) = 0;\r
74         virtual FX_BOOL                         IsCTRLKeyDown(FX_DWORD nFlag) = 0;\r
75         virtual FX_BOOL                         IsALTKeyDown(FX_DWORD nFlag) = 0;\r
76         virtual FX_BOOL                         IsINSERTKeyDown(FX_DWORD nFlag) = 0;\r
77 \r
78         virtual FX_SYSTEMTIME           GetLocalTime() = 0;\r
79 \r
80         virtual FX_INT32                        GetCharSet() = 0;       \r
81         virtual void                            SetCharSet(FX_INT32 nCharSet) = 0;\r
82 };\r
83 \r
84 #endif //_FX_SYSTEMHANDLER_H_\r
85 \r