blob: a2ad02438e718111626baa87901a3669cafeba1b [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
Tom Sepez940967d2017-05-18 12:32:20 -070010#include "core/fxcrt/cfx_unowned_ptr.h"
dsinclaira52ab742016-09-29 13:59:29 -070011#include "core/fxcrt/fx_coordinates.h"
Dan Sinclairbcd1e702017-08-31 13:19:18 -040012#include "core/fxcrt/fx_string.h"
dsinclaira52ab742016-09-29 13:59:29 -070013#include "core/fxcrt/fx_system.h"
dsinclairb9590102016-04-27 06:38:59 -070014
dsinclairb9590102016-04-27 06:38:59 -070015using TimerCallback = void (*)(int32_t idEvent);
16
17struct FX_SYSTEMTIME {
18 FX_SYSTEMTIME()
19 : wYear(0),
20 wMonth(0),
21 wDayOfWeek(0),
22 wDay(0),
23 wHour(0),
24 wMinute(0),
25 wSecond(0),
26 wMilliseconds(0) {}
27
28 uint16_t wYear;
29 uint16_t wMonth;
30 uint16_t wDayOfWeek;
31 uint16_t wDay;
32 uint16_t wHour;
33 uint16_t wMinute;
34 uint16_t wSecond;
35 uint16_t wMilliseconds;
36};
37
38// Cursor style. These must match the values in public/fpdf_formfill.h
39#define FXCT_ARROW 0
40#define FXCT_NESW 1
41#define FXCT_NWSE 2
42#define FXCT_VBEAM 3
43#define FXCT_HBEAM 4
44#define FXCT_HAND 5
45
dsinclair8faac622016-09-15 12:41:50 -070046class CFFL_FormFiller;
dsinclairb9590102016-04-27 06:38:59 -070047class CPDF_Document;
48class CPDF_Font;
dsinclair735606d2016-10-05 15:47:02 -070049class CPDFSDK_FormFillEnvironment;
dsinclair8faac622016-09-15 12:41:50 -070050class CPDFSDK_Widget;
dsinclairb9590102016-04-27 06:38:59 -070051
52class CFX_SystemHandler {
53 public:
Tom Sepez940967d2017-05-18 12:32:20 -070054 explicit CFX_SystemHandler(CPDFSDK_FormFillEnvironment* pFormFillEnv);
55 ~CFX_SystemHandler();
dsinclairb9590102016-04-27 06:38:59 -070056
Lei Zhang77f9bff2017-08-29 11:34:12 -070057 void InvalidateRect(CPDFSDK_Widget* widget, const CFX_FloatRect& rect);
dsinclair8faac622016-09-15 12:41:50 -070058 void OutputSelectedRect(CFFL_FormFiller* pFormFiller, CFX_FloatRect& rect);
dsinclairb9590102016-04-27 06:38:59 -070059 bool IsSelectionImplemented() const;
dsinclairb9590102016-04-27 06:38:59 -070060 void SetCursor(int32_t nCursorType);
Ryan Harrison275e2602017-09-18 14:23:18 -040061 bool FindNativeTrueTypeFont(ByteString sFontFaceName);
dsinclairb9590102016-04-27 06:38:59 -070062 CPDF_Font* AddNativeTrueTypeFontToPDF(CPDF_Document* pDoc,
Ryan Harrison275e2602017-09-18 14:23:18 -040063 ByteString sFontFaceName,
dsinclairb9590102016-04-27 06:38:59 -070064 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);
dsinclairb9590102016-04-27 06:38:59 -070068
dsinclairb9590102016-04-27 06:38:59 -070069 private:
Tom Sepez940967d2017-05-18 12:32:20 -070070 CFX_UnownedPtr<CPDFSDK_FormFillEnvironment> const m_pFormFillEnv;
dsinclairb9590102016-04-27 06:38:59 -070071};
72
73#endif // FPDFSDK_CFX_SYSTEMHANDLER_H_