Foxit PDF SDK
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 //#include "pdf/fs_pdfpage.h"
22 
28 namespace foxit {
32 namespace pdf {
33  class PDFPage;
37 namespace interform {
38 // forward declaration
39 class Form;
40 class Control;
41 
47  public:
55  virtual void OnTimer(int timer) = 0;
56 
57  protected:
58  ~TimerCallback() {}
59 };
60 
66  public:
72  virtual void Release() = 0;
73 
79  virtual int GetVersion() {return 1;}
80 
90  virtual void Refresh(const PDFPage& page, const RectF* rect) = 0;
91 
107  virtual bool SetTimerCallback(int elapse, TimerCallback* timer, int* out_timer_id) = 0;
108 
117  virtual bool KillTimer(int timer_id) = 0;
118 
131  virtual void FocusGotOnControl(const Control& control, const char* value) = 0;
132 
145  virtual void FocusLostFromControl(const Control& control, const char* value) = 0;
146 
147  protected:
149 };
150 
160 class Filler FS_FINAL : public Base {
161  public:
167  typedef enum _VirtualKeyCode {
171  e_VkeyBack = 0x08,
173  e_VkeyTab = 0x09,
175  e_VkeyReturn = 0x0D,
177  e_VkeyShift = 0x10,
181  e_VkeyMenu = 0x12,
183  e_VkeyPause = 0x13,
185  e_VkeyEscape = 0x1B,
187  e_VkeySpace = 0x20,
189  e_VkeyPrior = 0x21,
191  e_VkeyNext = 0x22,
193  e_VkeyEnd = 0x23,
195  e_VkeyHome = 0x24,
197  e_VkeyLeft = 0x25,
199  e_VkeyUp = 0x26,
201  e_VkeyRight = 0x27,
203  e_VkeyDown = 0x28,
205  e_VkeyPrint = 0x2A,
209  e_VkeyInsert = 0x2D,
211  e_VkeyDelete = 0x2E,
213  e_VkeyHelp = 0x2F,
215  e_Vkey0 = 0x30,
217  e_Vkey1 = 0x31,
219  e_Vkey2 = 0x32,
221  e_Vkey3 = 0x33,
223  e_Vkey4 = 0x34,
225  e_Vkey5 = 0x35,
227  e_Vkey6 = 0x36,
229  e_Vkey7 = 0x37,
231  e_Vkey8 = 0x38,
233  e_Vkey9 = 0x39,
235  e_VkeyA = 0x41,
237  e_VkeyB = 0x42,
239  e_VkeyC = 0x43,
241  e_VkeyD = 0x44,
243  e_VkeyE = 0x45,
245  e_VkeyF = 0x46,
247  e_VkeyG = 0x47,
249  e_VkeyH = 0x48,
251  e_VkeyI = 0x49,
253  e_VkeyJ = 0x4A,
255  e_VkeyK = 0x4B,
257  e_VkeyL = 0x4C,
259  e_VkeyM = 0x4D,
261  e_VkeyN = 0x4E,
263  e_VkeyO = 0x4F,
265  e_VkeyP = 0x50,
267  e_VkeyQ = 0x51,
269  e_VkeyR = 0x52,
271  e_VkeyS = 0x53,
273  e_VkeyT = 0x54,
275  e_VkeyU = 0x55,
277  e_VkeyV = 0x56,
279  e_VkeyW = 0x57,
281  e_VkeyX = 0x58,
283  e_VkeyY = 0x59,
285  e_VkeyZ = 0x5A,
309  e_VkeyAdd = 0x6B,
317  e_VkeyDivide = 0x6F,
319  e_VkeyF1 = 0x70,
321  e_VkeyF2 = 0x71,
323  e_VkeyF3 = 0x72,
325  e_VkeyF4 = 0x73,
327  e_VkeyF5 = 0x74,
329  e_VkeyF6 = 0x75,
331  e_VkeyF7 = 0x76,
333  e_VkeyF8 = 0x77,
335  e_VkeyF9 = 0x78,
337  e_VkeyF10 = 0x79,
339  e_VkeyF11 = 0x7A,
341  e_VkeyF12 = 0x7B
342  } VirtualKeyCode;
343 
349  typedef enum _EventFlags {
370  } EventFlags;
371 
372 
382  explicit Filler(const Form& form, FillerAssistCallback* assist);
383 
385  ~Filler();
386 
392  Filler(const Filler& other);
400  Filler& operator = (const Filler& other);
401 
409  bool operator == (const Filler& other) const;
417  bool operator != (const Filler& other) const;
418 
426  bool IsEmpty() const;
427 
444  void Render(const PDFPage& page, const Matrix& matrix,const common::Renderer& renderer);
445 
456  bool OnLButtonDown(const PDFPage& page, const PointF& point, uint32 flags);
457 
468  bool OnLButtonUp(const PDFPage& page, const PointF& point, uint32 flags);
469 
480  bool OnLButtonDoubleClick(const PDFPage& page, const PointF& point, uint32 flags);
481 
492  bool OnMouseMove(const PDFPage& page, const PointF& point, uint32 flags);
493 
505  bool OnMouseEnter(const PDFPage& page, const PointF& point, uint32 flags);
506 
518  bool OnMouseHover(const PDFPage& page, const PointF& point, uint32 flags);
519 
531  bool OnMouseLeave(const PDFPage& page, const PointF& point, uint32 flags);
532 
546  bool OnMouseWheel(const PDFPage& page, const PointF& point, int32 delta, uint32 flags);
547 
559  bool OnRButtonDown(const PDFPage& page, const PointF& point, uint32 flags);
560 
572  bool OnRButtonUp(const PDFPage& page, const PointF& point, uint32 flags);
573 
585  bool OnRButtonDoubleClick(const PDFPage& page, const PointF& point, uint32 flags);
586 
598  bool OnWheelButtonDown(const PDFPage& page, const PointF& point, uint32 flags);
599 
611  bool OnWheelButtonUp(const PDFPage& page, const PointF& point, uint32 flags);
612 
624  bool OnWheelButtonDoubleClick(const PDFPage& page, const PointF& point, uint32 flags);
625 
637  bool OnKeyDown(uint32 key_code, uint32 flags);
638 
650  bool OnKeyUp(uint32 key_code, uint32 flags);
651 
661  bool OnChar(uint32 char_code, uint32 flags);
662 
671  bool SetFocus(const Control& control);
672 
678  bool KillFocus();
679 
691  void HighlightFormFields(bool is_highlight);
692 
703  void SetHighlightColor(ARGB color);
704 
705  // User is strongly recommended NOT to use this method; otherwise unknown situation may occur.
706  explicit Filler(FS_HANDLE handle = NULL);
707 };
708 } // namespace interform
709 } // namespace pdf
710 } // namespace foxit
711 #endif // FS_FORMFILLER_H_
712 
bool OnLButtonDown(const PDFPage &page, const PointF &point, uint32 flags)
Call this function when left mouse button is down.
bool OnRButtonDoubleClick(const PDFPage &page, const PointF &point, uint32 flags)
(Reserved, unsupported yet) Call this function when right mouse button is double clicked.
X key.
Definition: fs_formfiller.h:281
Filler & operator=(const Filler &other)
Assign operator.
bool OnRButtonUp(const PDFPage &page, const PointF &point, uint32 flags)
(Reserved, unsupported yet) Call this function when right mouse button is up.
Z key.
Definition: fs_formfiller.h:285
F10 key.
Definition: fs_formfiller.h:337
bool OnMouseMove(const PDFPage &page, const PointF &point, uint32 flags)
Call this function when mouse moves.
F12 key.
Definition: fs_formfiller.h:341
Q key.
Definition: fs_formfiller.h:267
Event flag: the right button of the mouse is down.
Definition: fs_formfiller.h:367
F key.
Definition: fs_formfiller.h:245
Print key.
Definition: fs_formfiller.h:205
3 key in the numeric keypad.
Definition: fs_formfiller.h:293
Event flag: meta key.
Definition: fs_formfiller.h:357
Definition: fs_formfiller.h:160
Page Down key.
Definition: fs_formfiller.h:191
Left arrow key.
Definition: fs_formfiller.h:197
bool IsEmpty() const
Check whether current object is empty or not.
bool OnWheelButtonDoubleClick(const PDFPage &page, const PointF &point, uint32 flags)
(Reserved, unsupported yet) Call this function when mouse wheel button is double clicked.
Definition: fx_coordinates.h:30
6 key.
Definition: fs_formfiller.h:227
F6 key.
Definition: fs_formfiller.h:329
I key.
Definition: fs_formfiller.h:251
Event flag: "Alt" key.
Definition: fs_formfiller.h:355
void SetHighlightColor(ARGB color)
Set the highlight color used for highlighting form fields.
A key.
Definition: fs_formfiller.h:235
EventFlags
Enumeration for key event flags.
Definition: fs_formfiller.h:349
ESC key.
Definition: fs_formfiller.h:185
5 key.
Definition: fs_formfiller.h:225
Backspace key.
Definition: fs_formfiller.h:171
2 key.
Definition: fs_formfiller.h:219
virtual bool KillTimer(int timer_id)=0
A callback function used to kill the timer event by timer identifier.
3 key.
Definition: fs_formfiller.h:221
V key.
Definition: fs_formfiller.h:277
virtual void Refresh(const PDFPage &page, const RectF *rect)=0
A callback function used to refresh the specified area on a specified page.
Help key.
Definition: fs_formfiller.h:213
F3 key.
Definition: fs_formfiller.h:323
W key.
Definition: fs_formfiller.h:279
Definition: fs_formfiller.h:65
Definition: fs_pdfform.h:663
7 key in the numeric keypad.
Definition: fs_formfiller.h:301
4 key in the numeric keypad.
Definition: fs_formfiller.h:295
F8 key.
Definition: fs_formfiller.h:333
Delete key.
Definition: fs_formfiller.h:211
Definition: fs_pdfform.h:1075
C key.
Definition: fs_formfiller.h:239
Print Screen key.
Definition: fs_formfiller.h:207
8 key.
Definition: fs_formfiller.h:231
1 key in the numeric keypad.
Definition: fs_formfiller.h:289
E key.
Definition: fs_formfiller.h:243
Filler(const Form &form, FillerAssistCallback *assist)
Constructor.
bool SetFocus(const Control &control)
Set focus on a form control.
F7 key.
Definition: fs_formfiller.h:331
VirtualKeyCode
Enumeration for virtual key code.
Definition: fs_formfiller.h:167
U key.
Definition: fs_formfiller.h:275
virtual void OnTimer(int timer)=0
A callback function used as a timer on every time interval.
Definition: fs_render.h:70
Minus key in the numeric keypad.
Definition: fs_formfiller.h:313
Slash key in the numeric keypad.
Definition: fs_formfiller.h:317
uint32 ARGB
ARGB color type, 32 bits, ((b) | ((g) << 8) | ((r) << 16)) | ((a) << 24)
Definition: fs_basictypes.h:212
Insert key.
Definition: fs_formfiller.h:209
bool OnLButtonUp(const PDFPage &page, const PointF &point, uint32 flags)
Call this function when left mouse button is up.
B key.
Definition: fs_formfiller.h:237
bool OnLButtonDoubleClick(const PDFPage &page, const PointF &point, uint32 flags)
Call this function when left mouse button is double clicked.
9 key in the numeric keypad.
Definition: fs_formfiller.h:305
Event flag: key pad.
Definition: fs_formfiller.h:359
Menu key.
Definition: fs_formfiller.h:181
bool OnMouseLeave(const PDFPage &page, const PointF &point, uint32 flags)
(Reserved, unsupported yet) Call this function when mouse leaves somewhere.
bool OnMouseEnter(const PDFPage &page, const PointF &point, uint32 flags)
(Reserved, unsupported yet) Call this function when mouse enters somewhere.
bool OnKeyDown(uint32 key_code, uint32 flags)
(Reserved, unsupported yet) Call this function when key on the keyboard is down.
bool OnKeyUp(uint32 key_code, uint32 flags)
(Reserved, unsupported yet) Call this function when key on the keyboard is up.
1 key.
Definition: fs_formfiller.h:217
P key.
Definition: fs_formfiller.h:265
bool OnChar(uint32 char_code, uint32 flags)
Call this function when a character code is about to be inputted to a form field.
F5 key.
Definition: fs_formfiller.h:327
Shift key.
Definition: fs_formfiller.h:177
4 key.
Definition: fs_formfiller.h:223
F9 key.
Definition: fs_formfiller.h:335
2 key in the numeric keypad.
Definition: fs_formfiller.h:291
K key.
Definition: fs_formfiller.h:255
virtual void Release()=0
A callback function used to release current callback object itself.
Y key.
Definition: fs_formfiller.h:283
7 key.
Definition: fs_formfiller.h:229
Ctrl key.
Definition: fs_formfiller.h:179
F1 key.
Definition: fs_formfiller.h:319
0 key.
Definition: fs_formfiller.h:215
F2 key.
Definition: fs_formfiller.h:321
T key.
Definition: fs_formfiller.h:273
bool operator==(const Filler &other) const
Equal operator.
FX_UINT32 uint32
32-bit unsigned integer.
Definition: fs_basictypes.h:198
bool OnRButtonDown(const PDFPage &page, const PointF &point, uint32 flags)
(Reserved, unsupported yet) Call this function when right mouse button is down.
5 key in the numeric keypad.
Definition: fs_formfiller.h:297
Definition: fs_pdfpage.h:313
Page Up key.
Definition: fs_formfiller.h:189
void * FS_HANDLE
Handle type.
Definition: fs_basictypes.h:216
Header file for common definitions and classes.
Event flag: the left button of the mouse is down.
Definition: fs_formfiller.h:363
Home key.
Definition: fs_formfiller.h:195
Event flag: the command key.
Definition: fs_formfiller.h:369
6 key in the numeric keypad.
Definition: fs_formfiller.h:299
8 key in the numeric keypad.
Definition: fs_formfiller.h:303
Tab key.
Definition: fs_formfiller.h:173
void Render(const PDFPage &page, const Matrix &matrix, const common::Renderer &renderer)
Draw the currently focused form control on the page.
FX_INT32 int32
32-bit signed integer.
Definition: fs_basictypes.h:196
Definition: fs_basictypes.h:375
bool OnWheelButtonUp(const PDFPage &page, const PointF &point, uint32 flags)
(Reserved, unsupported yet) Call this function when right mouse wheel button is up.
Plus key in the numeric keypad.
Definition: fs_formfiller.h:309
H key.
Definition: fs_formfiller.h:249
R key.
Definition: fs_formfiller.h:269
void HighlightFormFields(bool is_highlight)
Decide whether to highlight form fields or not.
N key.
Definition: fs_formfiller.h:261
L key.
Definition: fs_formfiller.h:257
Definition: fs_formfiller.h:46
Foxit namespace.
Definition: fs_compare.h:27
Dot key in the numeric keypad.
Definition: fs_formfiller.h:315
F4 key.
Definition: fs_formfiller.h:325
F11 key.
Definition: fs_formfiller.h:339
Down arrow key.
Definition: fs_formfiller.h:203
Pause Break key.
Definition: fs_formfiller.h:183
M key.
Definition: fs_formfiller.h:259
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.
Right arrow key.
Definition: fs_formfiller.h:201
Enter key.
Definition: fs_formfiller.h:175
Event flag: "Shift" key.
Definition: fs_formfiller.h:351
G key.
Definition: fs_formfiller.h:247
#define NULL
The null-pointer value.
Definition: fx_system.h:771
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.
Definition: fx_coordinates.h:1056
bool OnWheelButtonDown(const PDFPage &page, const PointF &point, uint32 flags)
(Reserved, unsupported yet) Call this function when right mouse wheel button is down.
0 key in the numeric keypad.
Definition: fs_formfiller.h:287
Event flag: auto repeat.
Definition: fs_formfiller.h:361
virtual bool SetTimerCallback(int elapse, TimerCallback *timer, int *out_timer_id)=0
A callback function used to set a system timer.
Space key.
Definition: fs_formfiller.h:187
An unknown key.
Definition: fs_formfiller.h:169
Header file for rendering related definitions and classes.
virtual int GetVersion()
Get the version of derived implementation, for compatibility reason.
Definition: fs_formfiller.h:79
J key.
Definition: fs_formfiller.h:253
Event flag: "Ctrl" key.
Definition: fs_formfiller.h:353
Multiply key in the numeric keypad.
Definition: fs_formfiller.h:307
Up arrow key.
Definition: fs_formfiller.h:199
S key.
Definition: fs_formfiller.h:271
End key.
Definition: fs_formfiller.h:193
Event flag: the middle button of the mouse is down.
Definition: fs_formfiller.h:365
O key.
Definition: fs_formfiller.h:263
bool KillFocus()
Kill focus from form.
Enter key in the numeric keypad.
Definition: fs_formfiller.h:311
D key.
Definition: fs_formfiller.h:241
bool OnMouseWheel(const PDFPage &page, const PointF &point, int32 delta, uint32 flags)
(Reserved, unsupported yet) Call this function when mouse wheel moves.
9 key.
Definition: fs_formfiller.h:233
Definition: fx_coordinates.h:766
bool OnMouseHover(const PDFPage &page, const PointF &point, uint32 flags)
(Reserved, unsupported yet) Call this function when mouse hovers somewhere.
bool operator!=(const Filler &other) const
Not equal operator.