diff options
Diffstat (limited to 'fpdfsdk/include/fx_systemhandler.h')
-rw-r--r-- | fpdfsdk/include/fx_systemhandler.h | 151 |
1 files changed, 79 insertions, 72 deletions
diff --git a/fpdfsdk/include/fx_systemhandler.h b/fpdfsdk/include/fx_systemhandler.h index bf59e452ea..31d3347477 100644 --- a/fpdfsdk/include/fx_systemhandler.h +++ b/fpdfsdk/include/fx_systemhandler.h @@ -7,13 +7,12 @@ #ifndef FPDFSDK_INCLUDE_FX_SYSTEMHANDLER_H_ #define FPDFSDK_INCLUDE_FX_SYSTEMHANDLER_H_ -typedef void* FX_HWND; -typedef void* FX_HMENU; -typedef void (*TimerCallback)(int32_t idEvent); +typedef void* FX_HWND; +typedef void* FX_HMENU; +typedef void (*TimerCallback)(int32_t idEvent); -typedef struct _FX_SYSTEMTIME -{ - _FX_SYSTEMTIME() +typedef struct _FX_SYSTEMTIME { + _FX_SYSTEMTIME() : wYear(0), wMonth(0), wDayOfWeek(0), @@ -22,72 +21,80 @@ typedef struct _FX_SYSTEMTIME wMinute(0), wSecond(0), wMilliseconds(0) {} - FX_WORD wYear; - FX_WORD wMonth; - FX_WORD wDayOfWeek; - FX_WORD wDay; - FX_WORD wHour; - FX_WORD wMinute; - FX_WORD wSecond; - FX_WORD wMilliseconds; -}FX_SYSTEMTIME; - -//cursor style -#define FXCT_ARROW 0 -#define FXCT_NESW 1 -#define FXCT_NWSE 2 -#define FXCT_VBEAM 3 -#define FXCT_HBEAM 4 -#define FXCT_HAND 5 - -class IFX_SystemHandler -{ -public: - virtual ~IFX_SystemHandler() {} - virtual void InvalidateRect(FX_HWND hWnd, FX_RECT rect) = 0; - virtual void OutputSelectedRect(void* pFormFiller, CPDF_Rect&rect) = 0; - - virtual FX_BOOL IsSelectionImplemented() = 0; - - virtual CFX_WideString GetClipboardText(FX_HWND hWnd) = 0; - virtual FX_BOOL SetClipboardText(FX_HWND hWnd, CFX_WideString string) = 0; - - virtual void ClientToScreen(FX_HWND hWnd, int32_t& x, int32_t& y) = 0; - virtual void ScreenToClient(FX_HWND hWnd, int32_t& x, int32_t& y) = 0; - - /*cursor style - FXCT_ARROW - FXCT_NESW - FXCT_NWSE - FXCT_VBEAM - FXCT_HBEAM - FXCT_HAND - */ - virtual void SetCursor(int32_t nCursorType) = 0; - - virtual FX_HMENU CreatePopupMenu() = 0; - virtual FX_BOOL AppendMenuItem(FX_HMENU hMenu, int32_t nIDNewItem, CFX_WideString string) = 0; - virtual FX_BOOL EnableMenuItem(FX_HMENU hMenu, int32_t nIDItem, FX_BOOL bEnabled) = 0; - virtual int32_t TrackPopupMenu(FX_HMENU hMenu, int32_t x, int32_t y, FX_HWND hParent) = 0; - virtual void DestroyMenu(FX_HMENU hMenu) = 0; - - virtual CFX_ByteString GetNativeTrueTypeFont(int32_t nCharset) = 0; - virtual FX_BOOL FindNativeTrueTypeFont(int32_t nCharset, CFX_ByteString sFontFaceName) = 0; - virtual CPDF_Font* AddNativeTrueTypeFontToPDF(CPDF_Document* pDoc, CFX_ByteString sFontFaceName, uint8_t nCharset) = 0; - - virtual int32_t SetTimer(int32_t uElapse, TimerCallback lpTimerFunc) = 0; - virtual void KillTimer(int32_t nID) = 0; - - - virtual FX_BOOL IsSHIFTKeyDown(FX_DWORD nFlag) = 0; - virtual FX_BOOL IsCTRLKeyDown(FX_DWORD nFlag) = 0; - virtual FX_BOOL IsALTKeyDown(FX_DWORD nFlag) = 0; - virtual FX_BOOL IsINSERTKeyDown(FX_DWORD nFlag) = 0; - - virtual FX_SYSTEMTIME GetLocalTime() = 0; - - virtual int32_t GetCharSet() = 0; - virtual void SetCharSet(int32_t nCharSet) = 0; + FX_WORD wYear; + FX_WORD wMonth; + FX_WORD wDayOfWeek; + FX_WORD wDay; + FX_WORD wHour; + FX_WORD wMinute; + FX_WORD wSecond; + FX_WORD wMilliseconds; +} FX_SYSTEMTIME; + +// cursor style +#define FXCT_ARROW 0 +#define FXCT_NESW 1 +#define FXCT_NWSE 2 +#define FXCT_VBEAM 3 +#define FXCT_HBEAM 4 +#define FXCT_HAND 5 + +class IFX_SystemHandler { + public: + virtual ~IFX_SystemHandler() {} + virtual void InvalidateRect(FX_HWND hWnd, FX_RECT rect) = 0; + virtual void OutputSelectedRect(void* pFormFiller, CPDF_Rect& rect) = 0; + + virtual FX_BOOL IsSelectionImplemented() = 0; + + virtual CFX_WideString GetClipboardText(FX_HWND hWnd) = 0; + virtual FX_BOOL SetClipboardText(FX_HWND hWnd, CFX_WideString string) = 0; + + virtual void ClientToScreen(FX_HWND hWnd, int32_t& x, int32_t& y) = 0; + virtual void ScreenToClient(FX_HWND hWnd, int32_t& x, int32_t& y) = 0; + + /*cursor style + FXCT_ARROW + FXCT_NESW + FXCT_NWSE + FXCT_VBEAM + FXCT_HBEAM + FXCT_HAND + */ + virtual void SetCursor(int32_t nCursorType) = 0; + + virtual FX_HMENU CreatePopupMenu() = 0; + virtual FX_BOOL AppendMenuItem(FX_HMENU hMenu, + int32_t nIDNewItem, + CFX_WideString string) = 0; + virtual FX_BOOL EnableMenuItem(FX_HMENU hMenu, + int32_t nIDItem, + FX_BOOL bEnabled) = 0; + virtual int32_t TrackPopupMenu(FX_HMENU hMenu, + int32_t x, + int32_t y, + FX_HWND hParent) = 0; + virtual void DestroyMenu(FX_HMENU hMenu) = 0; + + virtual CFX_ByteString GetNativeTrueTypeFont(int32_t nCharset) = 0; + virtual FX_BOOL FindNativeTrueTypeFont(int32_t nCharset, + CFX_ByteString sFontFaceName) = 0; + virtual CPDF_Font* AddNativeTrueTypeFontToPDF(CPDF_Document* pDoc, + CFX_ByteString sFontFaceName, + uint8_t nCharset) = 0; + + virtual int32_t SetTimer(int32_t uElapse, TimerCallback lpTimerFunc) = 0; + virtual void KillTimer(int32_t nID) = 0; + + virtual FX_BOOL IsSHIFTKeyDown(FX_DWORD nFlag) = 0; + virtual FX_BOOL IsCTRLKeyDown(FX_DWORD nFlag) = 0; + virtual FX_BOOL IsALTKeyDown(FX_DWORD nFlag) = 0; + virtual FX_BOOL IsINSERTKeyDown(FX_DWORD nFlag) = 0; + + virtual FX_SYSTEMTIME GetLocalTime() = 0; + + virtual int32_t GetCharSet() = 0; + virtual void SetCharSet(int32_t nCharSet) = 0; }; #endif // FPDFSDK_INCLUDE_FX_SYSTEMHANDLER_H_ |