My Project
fs_formfiller.h
Go to the documentation of this file.
1 
15 #ifndef FS_FORMFILLER_H_
16 #define FS_FORMFILLER_H_
17 
18 #include "common/fs_common.h"
19 #include "common/fs_render.h"
20 #include "pdf/fs_pdfpage.h"
21 
27 namespace foxit {
31 namespace pdf {
35 namespace interform {
36 // forward declaration
37 class Control;
38 
44  public:
52  virtual void OnTimer(int timer) = 0;
53 
54  protected:
55  ~TimerCallback() {}
56 };
57 
63  public:
69  virtual void Release() = 0;
70 
76  virtual int GetVersion() {return 1;}
77 
87  virtual void Refresh(const PDFPage& page, const RectF* rect) = 0;
88 
104  virtual bool SetTimerCallback(int elapse, TimerCallback* timer, int* out_timer_id) = 0;
105 
114  virtual bool KillTimer(int timer_id) = 0;
115 
128  virtual void FocusGotOnControl(const Control& control, const char* value) = 0;
129 
142  virtual void FocusLostFromControl(const Control& control, const char* value) = 0;
143 
144  protected:
146 };
147 
157 class Filler FS_FINAL : public Base {
158  public:
164  typedef enum _VirtualKeyCode {
168  e_VkeyBack = 0x08,
170  e_VkeyTab = 0x09,
172  e_VkeyReturn = 0x0D,
174  e_VkeyShift = 0x10,
178  e_VkeyMenu = 0x12,
180  e_VkeyPause = 0x13,
182  e_VkeyEscape = 0x1B,
184  e_VkeySpace = 0x20,
186  e_VkeyPrior = 0x21,
188  e_VkeyNext = 0x22,
190  e_VkeyEnd = 0x23,
192  e_VkeyHome = 0x24,
194  e_VkeyLeft = 0x25,
196  e_VkeyUp = 0x26,
198  e_VkeyRight = 0x27,
200  e_VkeyDown = 0x28,
202  e_VkeyPrint = 0x2A,
206  e_VkeyInsert = 0x2D,
208  e_VkeyDelete = 0x2E,
210  e_VkeyHelp = 0x2F,
212  e_Vkey0 = 0x30,
214  e_Vkey1 = 0x31,
216  e_Vkey2 = 0x32,
218  e_Vkey3 = 0x33,
220  e_Vkey4 = 0x34,
222  e_Vkey5 = 0x35,
224  e_Vkey6 = 0x36,
226  e_Vkey7 = 0x37,
228  e_Vkey8 = 0x38,
230  e_Vkey9 = 0x39,
232  e_VkeyA = 0x41,
234  e_VkeyB = 0x42,
236  e_VkeyC = 0x43,
238  e_VkeyD = 0x44,
240  e_VkeyE = 0x45,
242  e_VkeyF = 0x46,
244  e_VkeyG = 0x47,
246  e_VkeyH = 0x48,
248  e_VkeyI = 0x49,
250  e_VkeyJ = 0x4A,
252  e_VkeyK = 0x4B,
254  e_VkeyL = 0x4C,
256  e_VkeyM = 0x4D,
258  e_VkeyN = 0x4E,
260  e_VkeyO = 0x4F,
262  e_VkeyP = 0x50,
264  e_VkeyQ = 0x51,
266  e_VkeyR = 0x52,
268  e_VkeyS = 0x53,
270  e_VkeyT = 0x54,
272  e_VkeyU = 0x55,
274  e_VkeyV = 0x56,
276  e_VkeyW = 0x57,
278  e_VkeyX = 0x58,
280  e_VkeyY = 0x59,
282  e_VkeyZ = 0x5A,
306  e_VkeyAdd = 0x6B,
314  e_VkeyDivide = 0x6F,
316  e_VkeyF1 = 0x70,
318  e_VkeyF2 = 0x71,
320  e_VkeyF3 = 0x72,
322  e_VkeyF4 = 0x73,
324  e_VkeyF5 = 0x74,
326  e_VkeyF6 = 0x75,
328  e_VkeyF7 = 0x76,
330  e_VkeyF8 = 0x77,
332  e_VkeyF9 = 0x78,
334  e_VkeyF10 = 0x79,
336  e_VkeyF11 = 0x7A,
338  e_VkeyF12 = 0x7B
339  } VirtualKeyCode;
340 
346  typedef enum _EventFlags {
367  } EventFlags;
368 
369 
379  explicit Filler(const Form& form, FillerAssistCallback* assist);
380 
382  ~Filler();
383 
389  Filler(const Filler& other);
397  Filler& operator = (const Filler& other);
398 
406  bool operator == (const Filler& other) const;
414  bool operator != (const Filler& other) const;
415 
423  bool IsEmpty() const;
424 
441  void Render(const PDFPage& page, const Matrix& matrix,const common::Renderer& renderer);
442 
453  bool OnLButtonDown(const PDFPage& page, const PointF& point, uint32 flags);
454 
465  bool OnLButtonUp(const PDFPage& page, const PointF& point, uint32 flags);
466 
477  bool OnLButtonDoubleClick(const PDFPage& page, const PointF& point, uint32 flags);
478 
489  bool OnMouseMove(const PDFPage& page, const PointF& point, uint32 flags);
490 
502  bool OnMouseEnter(const PDFPage& page, const PointF& point, uint32 flags);
503 
515  bool OnMouseHover(const PDFPage& page, const PointF& point, uint32 flags);
516 
528  bool OnMouseLeave(const PDFPage& page, const PointF& point, uint32 flags);
529 
543  bool OnMouseWheel(const PDFPage& page, const PointF& point, int32 delta, uint32 flags);
544 
556  bool OnRButtonDown(const PDFPage& page, const PointF& point, uint32 flags);
557 
569  bool OnRButtonUp(const PDFPage& page, const PointF& point, uint32 flags);
570 
582  bool OnRButtonDoubleClick(const PDFPage& page, const PointF& point, uint32 flags);
583 
595  bool OnWheelButtonDown(const PDFPage& page, const PointF& point, uint32 flags);
596 
608  bool OnWheelButtonUp(const PDFPage& page, const PointF& point, uint32 flags);
609 
621  bool OnWheelButtonDoubleClick(const PDFPage& page, const PointF& point, uint32 flags);
622 
634  bool OnKeyDown(uint32 key_code, uint32 flags);
635 
647  bool OnKeyUp(uint32 key_code, uint32 flags);
648 
658  bool OnChar(uint32 char_code, uint32 flags);
659 
668  bool SetFocus(const Control& control);
669 
675  bool KillFocus();
676 
688  void HighlightFormFields(bool is_highlight);
689 
700  void SetHighlightColor(ARGB color);
701 
702  // User is strongly recommended NOT to use this method; otherwise unknown situation may occur.
703  explicit Filler(FS_HANDLE handle = NULL);
704 };
705 } // namespace interform
706 } // namespace pdf
707 } // namespace foxit
708 #endif // FS_FORMFILLER_H_
709 
Event flag: the command key.
Definition: fs_formfiller.h:366
bool OnMouseEnter(const PDFPage &page, const PointF &point, uint32 flags)
(Reserved, unsupported yet) Call this function when mouse enters somewhere.
bool OnWheelButtonDown(const PDFPage &page, const PointF &point, uint32 flags)
(Reserved, unsupported yet) Call this function when right mouse wheel button is down.
H key.
Definition: fs_formfiller.h:246
Menu key.
Definition: fs_formfiller.h:178
Definition: fs_pdfform.h:1061
F9 key.
Definition: fs_formfiller.h:332
Plus key in the numeric keypad.
Definition: fs_formfiller.h:306
bool OnKeyUp(uint32 key_code, uint32 flags)
(Reserved, unsupported yet) Call this function when key on the keyboard is up.
void * FS_HANDLE
Handle type.
Definition: fs_basictypes.h:216
Shift key.
Definition: fs_formfiller.h:174
Page Down key.
Definition: fs_formfiller.h:188
2 key in the numeric keypad.
Definition: fs_formfiller.h:288
bool OnWheelButtonUp(const PDFPage &page, const PointF &point, uint32 flags)
(Reserved, unsupported yet) Call this function when right mouse wheel button is up.
3 key.
Definition: fs_formfiller.h:218
X key.
Definition: fs_formfiller.h:278
3 key in the numeric keypad.
Definition: fs_formfiller.h:290
bool OnMouseMove(const PDFPage &page, const PointF &point, uint32 flags)
Call this function when mouse moves.
G key.
Definition: fs_formfiller.h:244
Event flag: the right button of the mouse is down.
Definition: fs_formfiller.h:364
bool OnRButtonDoubleClick(const PDFPage &page, const PointF &point, uint32 flags)
(Reserved, unsupported yet) Call this function when right mouse button is double clicked.
Multiply key in the numeric keypad.
Definition: fs_formfiller.h:304
Event flag: key pad.
Definition: fs_formfiller.h:356
V key.
Definition: fs_formfiller.h:274
Event flag: "Ctrl" key.
Definition: fs_formfiller.h:350
Definition: fs_formfiller.h:62
5 key.
Definition: fs_formfiller.h:222
F key.
Definition: fs_formfiller.h:242
bool OnMouseHover(const PDFPage &page, const PointF &point, uint32 flags)
(Reserved, unsupported yet) Call this function when mouse hovers somewhere.
L key.
Definition: fs_formfiller.h:254
Y key.
Definition: fs_formfiller.h:280
Header file for common definitions and classes.
Event flag: "Alt" key.
Definition: fs_formfiller.h:352
F5 key.
Definition: fs_formfiller.h:324
Minus key in the numeric keypad.
Definition: fs_formfiller.h:310
8 key in the numeric keypad.
Definition: fs_formfiller.h:300
6 key.
Definition: fs_formfiller.h:224
2 key.
Definition: fs_formfiller.h:216
W key.
Definition: fs_formfiller.h:276
9 key in the numeric keypad.
Definition: fs_formfiller.h:302
7 key.
Definition: fs_formfiller.h:226
Delete key.
Definition: fs_formfiller.h:208
F2 key.
Definition: fs_formfiller.h:318
0 key.
Definition: fs_formfiller.h:212
uint32 ARGB
ARGB color type, 32 bits, ((b) | ((g) << 8) | ((r) << 16)) | ((a) << 24)
Definition: fs_basictypes.h:212
bool OnKeyDown(uint32 key_code, uint32 flags)
(Reserved, unsupported yet) Call this function when key on the keyboard is down.
4 key.
Definition: fs_formfiller.h:220
N key.
Definition: fs_formfiller.h:258
F4 key.
Definition: fs_formfiller.h:322
End key.
Definition: fs_formfiller.h:190
Enter key in the numeric keypad.
Definition: fs_formfiller.h:308
Event flag: meta key.
Definition: fs_formfiller.h:354
C key.
Definition: fs_formfiller.h:236
Backspace key.
Definition: fs_formfiller.h:168
Event flag: the middle button of the mouse is down.
Definition: fs_formfiller.h:362
J key.
Definition: fs_formfiller.h:250
T key.
Definition: fs_formfiller.h:270
bool operator !=(const Filler &other) const
Not equal operator.
virtual int GetVersion()
Get the version of derived implementation, for compatibility reason.
Definition: fs_formfiller.h:76
R key.
Definition: fs_formfiller.h:266
Q key.
Definition: fs_formfiller.h:264
I key.
Definition: fs_formfiller.h:248
4 key in the numeric keypad.
Definition: fs_formfiller.h:292
Event flag: the left button of the mouse is down.
Definition: fs_formfiller.h:360
F6 key.
Definition: fs_formfiller.h:326
5 key in the numeric keypad.
Definition: fs_formfiller.h:294
F3 key.
Definition: fs_formfiller.h:320
F7 key.
Definition: fs_formfiller.h:328
Definition: fx_coordinates.h:30
Event flag: "Shift" key.
Definition: fs_formfiller.h:348
virtual void FocusGotOnControl(const Control &control, const char *value)=0
A callback function which is triggered when the focus is set to a form control.
bool OnChar(uint32 char_code, uint32 flags)
Call this function when a character code is about to be inputted to a form field.
E key.
Definition: fs_formfiller.h:240
F11 key.
Definition: fs_formfiller.h:336
Insert key.
Definition: fs_formfiller.h:206
Header file for rendering related definitions and classes.
Header file for PDF page related definitions and classes.
F1 key.
Definition: fs_formfiller.h:316
void HighlightFormFields(bool is_highlight)
Decide whether to highlight form fields or not.
Enter key.
Definition: fs_formfiller.h:172
Foxit namespace.
Definition: fs_connectedpdf.h:26
Z key.
Definition: fs_formfiller.h:282
S key.
Definition: fs_formfiller.h:268
void Render(const PDFPage &page, const Matrix &matrix, const common::Renderer &renderer)
Draw the currently focused form control on the page.
Right arrow key.
Definition: fs_formfiller.h:198
Filler(const Form &form, FillerAssistCallback *assist)
Constructor.
Up arrow key.
Definition: fs_formfiller.h:196
bool OnLButtonDown(const PDFPage &page, const PointF &point, uint32 flags)
Call this function when left mouse button is down.
A key.
Definition: fs_formfiller.h:232
Filler & operator=(const Filler &other)
Assign operator.
F10 key.
Definition: fs_formfiller.h:334
virtual void Refresh(const PDFPage &page, const RectF *rect)=0
A callback function used to refresh the specified area on a specified page.
Definition: fs_formfiller.h:157
void SetHighlightColor(ARGB color)
Set the highlight color used for highlighting form fields.
Tab key.
Definition: fs_formfiller.h:170
Definition: fs_formfiller.h:43
1 key.
Definition: fs_formfiller.h:214
bool OnMouseWheel(const PDFPage &page, const PointF &point, int32 delta, uint32 flags)
(Reserved, unsupported yet) Call this function when mouse wheel moves.
Pause Break key.
Definition: fs_formfiller.h:180
8 key.
Definition: fs_formfiller.h:228
bool operator==(const Filler &other) const
Equal operator.
#define NULL
The null-pointer value.
Definition: fx_system.h:773
Definition: fx_coordinates.h:763
Ctrl key.
Definition: fs_formfiller.h:176
D key.
Definition: fs_formfiller.h:238
Event flag: auto repeat.
Definition: fs_formfiller.h:358
bool KillFocus()
Kill focus from form.
virtual void Release()=0
A callback function used to release current callback object itself.
F8 key.
Definition: fs_formfiller.h:330
M key.
Definition: fs_formfiller.h:256
Print key.
Definition: fs_formfiller.h:202
bool IsEmpty() const
Check whether current object is empty or not.
bool OnRButtonDown(const PDFPage &page, const PointF &point, uint32 flags)
(Reserved, unsupported yet) Call this function when right mouse button is down.
Definition: fs_pdfpage.h:307
VirtualKeyCode
Enumeration for virtual key code.
Definition: fs_formfiller.h:164
1 key in the numeric keypad.
Definition: fs_formfiller.h:286
virtual void FocusLostFromControl(const Control &control, const char *value)=0
A callback function which is triggered when the focus is lost from a form control.
bool OnLButtonUp(const PDFPage &page, const PointF &point, uint32 flags)
Call this function when left mouse button is up.
FX_INT32 int32
32-bit signed integer.
Definition: fs_basictypes.h:196
K key.
Definition: fs_formfiller.h:252
Help key.
Definition: fs_formfiller.h:210
Home key.
Definition: fs_formfiller.h:192
An unknown key.
Definition: fs_formfiller.h:166
bool OnLButtonDoubleClick(const PDFPage &page, const PointF &point, uint32 flags)
Call this function when left mouse button is double clicked.
Page Up key.
Definition: fs_formfiller.h:186
Down arrow key.
Definition: fs_formfiller.h:200
virtual bool SetTimerCallback(int elapse, TimerCallback *timer, int *out_timer_id)=0
A callback function used to set a system timer.
bool OnRButtonUp(const PDFPage &page, const PointF &point, uint32 flags)
(Reserved, unsupported yet) Call this function when right mouse button is up.
F12 key.
Definition: fs_formfiller.h:338
Left arrow key.
Definition: fs_formfiller.h:194
Print Screen key.
Definition: fs_formfiller.h:204
Dot key in the numeric keypad.
Definition: fs_formfiller.h:312
Definition: fx_coordinates.h:1053
EventFlags
Enumeration for key event flags.
Definition: fs_formfiller.h:346
7 key in the numeric keypad.
Definition: fs_formfiller.h:298
P key.
Definition: fs_formfiller.h:262
O key.
Definition: fs_formfiller.h:260
virtual bool KillTimer(int timer_id)=0
A callback function used to kill the timer event by timer identifier.
Slash key in the numeric keypad.
Definition: fs_formfiller.h:314
bool SetFocus(const Control &control)
Set focus on a form control.
bool OnMouseLeave(const PDFPage &page, const PointF &point, uint32 flags)
(Reserved, unsupported yet) Call this function when mouse leaves somewhere.
U key.
Definition: fs_formfiller.h:272
bool OnWheelButtonDoubleClick(const PDFPage &page, const PointF &point, uint32 flags)
(Reserved, unsupported yet) Call this function when mouse wheel button is double clicked.
virtual void OnTimer(int timer)=0
A callback function used as a timer on every time interval.
0 key in the numeric keypad.
Definition: fs_formfiller.h:284
FX_UINT32 uint32
32-bit unsigned integer.
Definition: fs_basictypes.h:198
6 key in the numeric keypad.
Definition: fs_formfiller.h:296
9 key.
Definition: fs_formfiller.h:230
Definition: fs_render.h:66
Definition: fs_basictypes.h:342
B key.
Definition: fs_formfiller.h:234
Space key.
Definition: fs_formfiller.h:184
Definition: fs_pdfform.h:663
ESC key.
Definition: fs_formfiller.h:182

Foxit Software Corporation Logo
@2019 Foxit Software Incorporated. All rights reserved.