Convert all line endings to LF.
[pdfium.git] / fpdfsdk / include / fx_systemhandler.h
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 _FX_SYSTEMHANDLER_H_
8 #define _FX_SYSTEMHANDLER_H_
9
10 typedef FX_LPVOID                               FX_HWND;
11 typedef FX_LPVOID                               FX_HMENU;
12 typedef void                                    (*TimerCallback)(FX_INT32 idEvent);
13
14 typedef struct _FX_SYSTEMTIME 
15 {
16     FX_WORD wYear;
17     FX_WORD wMonth;
18     FX_WORD wDayOfWeek;
19     FX_WORD wDay;
20     FX_WORD wHour;
21     FX_WORD wMinute;
22     FX_WORD wSecond;
23     FX_WORD wMilliseconds;
24 }FX_SYSTEMTIME;
25
26 //cursor style
27 #define FXCT_ARROW                              0
28 #define FXCT_NESW                               1
29 #define FXCT_NWSE                               2
30 #define FXCT_VBEAM                              3
31 #define FXCT_HBEAM                              4
32 #define FXCT_HAND                               5
33
34 class IFX_SystemHandler
35 {
36 public:
37         virtual ~IFX_SystemHandler() {}
38         virtual void                            InvalidateRect(FX_HWND hWnd, FX_RECT rect) = 0;
39     virtual void                                OutputSelectedRect(void* pFormFiller, CPDF_Rect&rect) = 0;
40
41         virtual FX_BOOL                         IsSelectionImplemented() = 0;
42
43         virtual CFX_WideString          GetClipboardText(FX_HWND hWnd) = 0;
44         virtual FX_BOOL                         SetClipboardText(FX_HWND hWnd, CFX_WideString string) = 0;
45         
46         virtual void                            ClientToScreen(FX_HWND hWnd, FX_INT32& x, FX_INT32& y) = 0;
47         virtual void                            ScreenToClient(FX_HWND hWnd, FX_INT32& x, FX_INT32& y) = 0;
48
49         /*cursor style
50         FXCT_ARROW      
51         FXCT_NESW               
52         FXCT_NWSE               
53         FXCT_VBEAM              
54         FXCT_HBEAM              
55         FXCT_HAND
56         */
57         virtual void                            SetCursor(FX_INT32 nCursorType) = 0;
58
59         virtual FX_HMENU                        CreatePopupMenu() = 0;
60         virtual FX_BOOL                         AppendMenuItem(FX_HMENU hMenu, FX_INT32 nIDNewItem, CFX_WideString string) = 0;
61         virtual FX_BOOL                         EnableMenuItem(FX_HMENU hMenu, FX_INT32 nIDItem, FX_BOOL bEnabled) = 0;
62         virtual FX_INT32                        TrackPopupMenu(FX_HMENU hMenu, FX_INT32 x, FX_INT32 y, FX_HWND hParent) = 0;
63         virtual void                            DestroyMenu(FX_HMENU hMenu) = 0;
64
65         virtual CFX_ByteString          GetNativeTrueTypeFont(FX_INT32 nCharset) = 0;
66         virtual FX_BOOL                         FindNativeTrueTypeFont(FX_INT32 nCharset, CFX_ByteString sFontFaceName) = 0;
67         virtual CPDF_Font*                      AddNativeTrueTypeFontToPDF(CPDF_Document* pDoc, CFX_ByteString sFontFaceName, FX_BYTE nCharset) = 0;
68
69         virtual FX_INT32                        SetTimer(FX_INT32 uElapse, TimerCallback lpTimerFunc) = 0;
70         virtual void                            KillTimer(FX_INT32 nID) = 0;
71
72
73         virtual FX_BOOL                         IsSHIFTKeyDown(FX_DWORD nFlag) = 0;
74         virtual FX_BOOL                         IsCTRLKeyDown(FX_DWORD nFlag) = 0;
75         virtual FX_BOOL                         IsALTKeyDown(FX_DWORD nFlag) = 0;
76         virtual FX_BOOL                         IsINSERTKeyDown(FX_DWORD nFlag) = 0;
77
78         virtual FX_SYSTEMTIME           GetLocalTime() = 0;
79
80         virtual FX_INT32                        GetCharSet() = 0;       
81         virtual void                            SetCharSet(FX_INT32 nCharSet) = 0;
82 };
83
84 #endif //_FX_SYSTEMHANDLER_H_
85