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 
156 class Filler FS_FINAL : public Base {
157  public:
163  typedef enum _VirtualKeyCode {
167  e_VkeyBack = 0x08,
169  e_VkeyTab = 0x09,
171  e_VkeyReturn = 0x0D,
173  e_VkeyShift = 0x10,
177  e_VkeyMenu = 0x12,
179  e_VkeyPause = 0x13,
181  e_VkeyEscape = 0x1B,
183  e_VkeySpace = 0x20,
185  e_VkeyPrior = 0x21,
187  e_VkeyNext = 0x22,
189  e_VkeyEnd = 0x23,
191  e_VkeyHome = 0x24,
193  e_VkeyLeft = 0x25,
195  e_VkeyUp = 0x26,
197  e_VkeyRight = 0x27,
199  e_VkeyDown = 0x28,
201  e_VkeyPrint = 0x2A,
205  e_VkeyInsert = 0x2D,
207  e_VkeyDelete = 0x2E,
209  e_VkeyHelp = 0x2F,
211  e_Vkey0 = 0x30,
213  e_Vkey1 = 0x31,
215  e_Vkey2 = 0x32,
217  e_Vkey3 = 0x33,
219  e_Vkey4 = 0x34,
221  e_Vkey5 = 0x35,
223  e_Vkey6 = 0x36,
225  e_Vkey7 = 0x37,
227  e_Vkey8 = 0x38,
229  e_Vkey9 = 0x39,
231  e_VkeyA = 0x41,
233  e_VkeyB = 0x42,
235  e_VkeyC = 0x43,
237  e_VkeyD = 0x44,
239  e_VkeyE = 0x45,
241  e_VkeyF = 0x46,
243  e_VkeyG = 0x47,
245  e_VkeyH = 0x48,
247  e_VkeyI = 0x49,
249  e_VkeyJ = 0x4A,
251  e_VkeyK = 0x4B,
253  e_VkeyL = 0x4C,
255  e_VkeyM = 0x4D,
257  e_VkeyN = 0x4E,
259  e_VkeyO = 0x4F,
261  e_VkeyP = 0x50,
263  e_VkeyQ = 0x51,
265  e_VkeyR = 0x52,
267  e_VkeyS = 0x53,
269  e_VkeyT = 0x54,
271  e_VkeyU = 0x55,
273  e_VkeyV = 0x56,
275  e_VkeyW = 0x57,
277  e_VkeyX = 0x58,
279  e_VkeyY = 0x59,
281  e_VkeyZ = 0x5A,
305  e_VkeyAdd = 0x6B,
313  e_VkeyDivide = 0x6F,
315  e_VkeyF1 = 0x70,
317  e_VkeyF2 = 0x71,
319  e_VkeyF3 = 0x72,
321  e_VkeyF4 = 0x73,
323  e_VkeyF5 = 0x74,
325  e_VkeyF6 = 0x75,
327  e_VkeyF7 = 0x76,
329  e_VkeyF8 = 0x77,
331  e_VkeyF9 = 0x78,
333  e_VkeyF10 = 0x79,
335  e_VkeyF11 = 0x7A,
337  e_VkeyF12 = 0x7B
338  } VirtualKeyCode;
339 
345  typedef enum _EventFlags {
366  } EventFlags;
367 
368 
378  explicit Filler(const Form& form, FillerAssistCallback* assist);
379 
381  ~Filler();
382 
388  Filler(const Filler& other);
396  Filler& operator = (const Filler& other);
397 
405  bool operator == (const Filler& other) const;
413  bool operator != (const Filler& other) const;
414 
422  bool IsEmpty() const;
423 
440  void Render(const PDFPage& page, const Matrix& matrix,const common::Renderer& renderer);
441 
452  bool OnLButtonDown(const PDFPage& page, const PointF& point, uint32 flags);
453 
464  bool OnLButtonUp(const PDFPage& page, const PointF& point, uint32 flags);
465 
476  bool OnLButtonDoubleClick(const PDFPage& page, const PointF& point, uint32 flags);
477 
488  bool OnMouseMove(const PDFPage& page, const PointF& point, uint32 flags);
489 
501  bool OnMouseEnter(const PDFPage& page, const PointF& point, uint32 flags);
502 
514  bool OnMouseHover(const PDFPage& page, const PointF& point, uint32 flags);
515 
527  bool OnMouseLeave(const PDFPage& page, const PointF& point, uint32 flags);
528 
542  bool OnMouseWheel(const PDFPage& page, const PointF& point, int32 delta, uint32 flags);
543 
555  bool OnRButtonDown(const PDFPage& page, const PointF& point, uint32 flags);
556 
568  bool OnRButtonUp(const PDFPage& page, const PointF& point, uint32 flags);
569 
581  bool OnRButtonDoubleClick(const PDFPage& page, const PointF& point, uint32 flags);
582 
594  bool OnWheelButtonDown(const PDFPage& page, const PointF& point, uint32 flags);
595 
607  bool OnWheelButtonUp(const PDFPage& page, const PointF& point, uint32 flags);
608 
620  bool OnWheelButtonDoubleClick(const PDFPage& page, const PointF& point, uint32 flags);
621 
633  bool OnKeyDown(uint32 key_code, uint32 flags);
634 
646  bool OnKeyUp(uint32 key_code, uint32 flags);
647 
657  bool OnChar(uint32 char_code, uint32 flags);
658 
667  bool SetFocus(const Control& control);
668 
674  bool KillFocus();
675 
687  void HighlightFormFields(bool is_highlight);
688 
699  void SetHighlightColor(ARGB color);
700 
701  // User is strongly recommended NOT to use this method; otherwise unknown situation may occur.
702  explicit Filler(FS_HANDLE handle = NULL);
703 };
704 } // namespace interform
705 } // namespace pdf
706 } // namespace foxit
707 #endif // FS_FORMFILLER_H_
708 
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:277
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:281
F10 key.
Definition: fs_formfiller.h:333
bool OnMouseMove(const PDFPage &page, const PointF &point, uint32 flags)
Call this function when mouse moves.
F12 key.
Definition: fs_formfiller.h:337
Q key.
Definition: fs_formfiller.h:263
Event flag: the right button of the mouse is down.
Definition: fs_formfiller.h:363
F key.
Definition: fs_formfiller.h:241
Print key.
Definition: fs_formfiller.h:201
3 key in the numeric keypad.
Definition: fs_formfiller.h:289
Event flag: meta key.
Definition: fs_formfiller.h:353
Definition: fs_formfiller.h:156
Page Down key.
Definition: fs_formfiller.h:187
Left arrow key.
Definition: fs_formfiller.h:193
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.
6 key.
Definition: fs_formfiller.h:223
F6 key.
Definition: fs_formfiller.h:325
I key.
Definition: fs_formfiller.h:247
Event flag: "Alt" key.
Definition: fs_formfiller.h:351
void SetHighlightColor(ARGB color)
Set the highlight color used for highlighting form fields.
A key.
Definition: fs_formfiller.h:231
EventFlags
Enumeration for key event flags.
Definition: fs_formfiller.h:345
ESC key.
Definition: fs_formfiller.h:181
5 key.
Definition: fs_formfiller.h:221
Backspace key.
Definition: fs_formfiller.h:167
2 key.
Definition: fs_formfiller.h:215
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:217
V key.
Definition: fs_formfiller.h:273
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:209
F3 key.
Definition: fs_formfiller.h:319
W key.
Definition: fs_formfiller.h:275
Definition: fs_formfiller.h:62
Definition: fs_pdfform.h:665
7 key in the numeric keypad.
Definition: fs_formfiller.h:297
4 key in the numeric keypad.
Definition: fs_formfiller.h:291
F8 key.
Definition: fs_formfiller.h:329
Delete key.
Definition: fs_formfiller.h:207
Definition: fs_pdfform.h:1062
C key.
Definition: fs_formfiller.h:235
Print Screen key.
Definition: fs_formfiller.h:203
8 key.
Definition: fs_formfiller.h:227
1 key in the numeric keypad.
Definition: fs_formfiller.h:285
E key.
Definition: fs_formfiller.h:239
Filler(const Form &form, FillerAssistCallback *assist)
Constructor.
bool SetFocus(const Control &control)
Set focus on a form control.
F7 key.
Definition: fs_formfiller.h:327
VirtualKeyCode
Enumeration for virtual key code.
Definition: fs_formfiller.h:163
U key.
Definition: fs_formfiller.h:271
virtual void OnTimer(int timer)=0
A callback function used as a timer on every time interval.
Definition: fs_render.h:65
Minus key in the numeric keypad.
Definition: fs_formfiller.h:309
Slash key in the numeric keypad.
Definition: fs_formfiller.h:313
uint32 ARGB
ARGB color type, 32 bits, ((b) | ((g) << 8) | ((r) << 16)) | ((a) << 24)
Definition: fs_basictypes.h:209
Insert key.
Definition: fs_formfiller.h:205
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:233
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:301
Event flag: key pad.
Definition: fs_formfiller.h:355
Menu key.
Definition: fs_formfiller.h:177
bool OnMouseLeave(const PDFPage &page, const PointF &point, uint32 flags)
(Reserved, unsupported yet) Call this function when mouse leaves somewhere.
CFX_PointF PointF
Point information, in float.
Definition: fs_basictypes.h:353
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:213
P key.
Definition: fs_formfiller.h:261
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:323
Shift key.
Definition: fs_formfiller.h:173
4 key.
Definition: fs_formfiller.h:219
F9 key.
Definition: fs_formfiller.h:331
2 key in the numeric keypad.
Definition: fs_formfiller.h:287
K key.
Definition: fs_formfiller.h:251
virtual void Release()=0
A callback function used to release current FillerAssistCallback object itself.
Y key.
Definition: fs_formfiller.h:279
7 key.
Definition: fs_formfiller.h:225
Ctrl key.
Definition: fs_formfiller.h:175
F1 key.
Definition: fs_formfiller.h:315
0 key.
Definition: fs_formfiller.h:211
F2 key.
Definition: fs_formfiller.h:317
T key.
Definition: fs_formfiller.h:269
bool operator==(const Filler &other) const
Equal operator.
FX_UINT32 uint32
32-bit unsigned integer.
Definition: fs_basictypes.h:195
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:293
Definition: fs_pdfpage.h:306
Page Up key.
Definition: fs_formfiller.h:185
void * FS_HANDLE
Handle type.
Definition: fs_basictypes.h:213
Header file for common definitions and classes.
Event flag: the left button of the mouse is down.
Definition: fs_formfiller.h:359
Home key.
Definition: fs_formfiller.h:191
Event flag: the command key.
Definition: fs_formfiller.h:365
6 key in the numeric keypad.
Definition: fs_formfiller.h:295
8 key in the numeric keypad.
Definition: fs_formfiller.h:299
Tab key.
Definition: fs_formfiller.h:169
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:193
Definition: fs_basictypes.h:333
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:305
H key.
Definition: fs_formfiller.h:245
Header file for PDF page related definitions and classes.
R key.
Definition: fs_formfiller.h:265
void HighlightFormFields(bool is_highlight)
Decide whether to highlight form fields or not.
N key.
Definition: fs_formfiller.h:257
L key.
Definition: fs_formfiller.h:253
Definition: fs_formfiller.h:43
Foxit namespace.
Definition: fs_connectedpdf.h:26
Dot key in the numeric keypad.
Definition: fs_formfiller.h:311
F4 key.
Definition: fs_formfiller.h:321
F11 key.
Definition: fs_formfiller.h:335
Down arrow key.
Definition: fs_formfiller.h:199
Pause Break key.
Definition: fs_formfiller.h:179
M key.
Definition: fs_formfiller.h:255
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:197
Enter key.
Definition: fs_formfiller.h:171
Event flag: "Shift" key.
Definition: fs_formfiller.h:347
G key.
Definition: fs_formfiller.h:243
#define NULL
The null-pointer value.
Definition: fx_system.h:767
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:914
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:283
Event flag: auto repeat.
Definition: fs_formfiller.h:357
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:183
An unknown key.
Definition: fs_formfiller.h:165
Header file for rendering related definitions and classes.
virtual int GetVersion()
Get the version of derived implementation, for compatibility reason.
Definition: fs_formfiller.h:76
J key.
Definition: fs_formfiller.h:249
Event flag: "Ctrl" key.
Definition: fs_formfiller.h:349
Multiply key in the numeric keypad.
Definition: fs_formfiller.h:303
Up arrow key.
Definition: fs_formfiller.h:195
S key.
Definition: fs_formfiller.h:267
End key.
Definition: fs_formfiller.h:189
Event flag: the middle button of the mouse is down.
Definition: fs_formfiller.h:361
O key.
Definition: fs_formfiller.h:259
bool KillFocus()
Kill focus from form.
Enter key in the numeric keypad.
Definition: fs_formfiller.h:307
D key.
Definition: fs_formfiller.h:237
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:229
Definition: fx_coordinates.h:627
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.

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