blob: 53043904e62a2205faad973ded5653e5e4015fe3 [file] [log] [blame]
dsinclairb9590102016-04-27 06:38:59 -07001// Copyright 2016 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_CFX_SYSTEMHANDLER_H_
8#define FPDFSDK_CFX_SYSTEMHANDLER_H_
9
dsinclaira52ab742016-09-29 13:59:29 -070010#include "core/fxcrt/fx_coordinates.h"
11#include "core/fxcrt/fx_system.h"
dsinclairb9590102016-04-27 06:38:59 -070012
dsinclairb9590102016-04-27 06:38:59 -070013using TimerCallback = void (*)(int32_t idEvent);
14
15struct FX_SYSTEMTIME {
16 FX_SYSTEMTIME()
17 : wYear(0),
18 wMonth(0),
19 wDayOfWeek(0),
20 wDay(0),
21 wHour(0),
22 wMinute(0),
23 wSecond(0),
24 wMilliseconds(0) {}
25
26 uint16_t wYear;
27 uint16_t wMonth;
28 uint16_t wDayOfWeek;
29 uint16_t wDay;
30 uint16_t wHour;
31 uint16_t wMinute;
32 uint16_t wSecond;
33 uint16_t wMilliseconds;
34};
35
36// Cursor style. These must match the values in public/fpdf_formfill.h
37#define FXCT_ARROW 0
38#define FXCT_NESW 1
39#define FXCT_NWSE 2
40#define FXCT_VBEAM 3
41#define FXCT_HBEAM 4
42#define FXCT_HAND 5
43
dsinclair8faac622016-09-15 12:41:50 -070044class CFFL_FormFiller;
dsinclairb9590102016-04-27 06:38:59 -070045class CPDF_Document;
46class CPDF_Font;
dsinclair79db6092016-09-14 07:27:21 -070047class CPDFSDK_Environment;
dsinclair8faac622016-09-15 12:41:50 -070048class CPDFSDK_Widget;
dsinclairb9590102016-04-27 06:38:59 -070049
50class CFX_SystemHandler {
51 public:
dsinclair79db6092016-09-14 07:27:21 -070052 explicit CFX_SystemHandler(CPDFSDK_Environment* pEnv) : m_pEnv(pEnv) {}
dsinclairb9590102016-04-27 06:38:59 -070053 ~CFX_SystemHandler() {}
54
dsinclair8faac622016-09-15 12:41:50 -070055 void InvalidateRect(CPDFSDK_Widget* widget, FX_RECT rect);
56 void OutputSelectedRect(CFFL_FormFiller* pFormFiller, CFX_FloatRect& rect);
dsinclairb9590102016-04-27 06:38:59 -070057 bool IsSelectionImplemented() const;
58
59 void SetCursor(int32_t nCursorType);
60
thestig907a5222016-06-21 14:38:27 -070061 bool FindNativeTrueTypeFont(CFX_ByteString sFontFaceName);
dsinclairb9590102016-04-27 06:38:59 -070062 CPDF_Font* AddNativeTrueTypeFontToPDF(CPDF_Document* pDoc,
63 CFX_ByteString sFontFaceName,
64 uint8_t nCharset);
dsinclair8faac622016-09-15 12:41:50 -070065
dsinclairb9590102016-04-27 06:38:59 -070066 int32_t SetTimer(int32_t uElapse, TimerCallback lpTimerFunc);
67 void KillTimer(int32_t nID);
dsinclair8faac622016-09-15 12:41:50 -070068
dsinclairb9590102016-04-27 06:38:59 -070069 bool IsSHIFTKeyDown(uint32_t nFlag) const;
70 bool IsCTRLKeyDown(uint32_t nFlag) const;
71 bool IsALTKeyDown(uint32_t nFlag) const;
dsinclairb9590102016-04-27 06:38:59 -070072
dsinclairb9590102016-04-27 06:38:59 -070073 private:
dsinclair79db6092016-09-14 07:27:21 -070074 CPDFSDK_Environment* const m_pEnv;
dsinclairb9590102016-04-27 06:38:59 -070075};
76
77#endif // FPDFSDK_CFX_SYSTEMHANDLER_H_