wxMaxima
Loading...
Searching...
No Matches
pdfform.h
Go to the documentation of this file.
1
2// Name: pdfform.h
3// Purpose:
4// Author: Ulrich Telle
5// Created: 2006-01-18
6// Copyright: (c) Ulrich Telle
7// Licence: wxWindows licence
9
11
12#ifndef _PDF_FORM_H_
13#define _PDF_FORM_H_
14
15// wxWidgets headers
16#include <wx/arrstr.h>
17#include <wx/string.h>
18
19// wxPdfDocument headers
20#include "wx/pdfdocdef.h"
21
24{
25 wxPDF_OBJECT_INDIRECT,
26 wxPDF_OBJECT_RADIOGROUP,
27
28 wxPDF_OBJECT_ANNOTATION,
29 wxPDF_OBJECT_TEXTANNOTATION,
30
31 wxPDF_OBJECT_WIDGET,
32 wxPDF_OBJECT_WIDGET_CHECKBOX,
33 wxPDF_OBJECT_WIDGET_COMBOBOX,
34 wxPDF_OBJECT_WIDGET_PUSHBUTTON,
35 wxPDF_OBJECT_WIDGET_RADIOBUTTON,
36 wxPDF_OBJECT_WIDGET_TEXTFIELD
37};
38
41class WXDLLIMPEXP_PDFDOC wxPdfIndirectObject
42{
43public:
45
49 wxPdfIndirectObject(int objectId, int generationId);
50
52 virtual ~wxPdfIndirectObject();
53
55
58 wxPdfObjectType GetType() { return m_type; }
59
61
64 void SetType(wxPdfObjectType type) { m_type = type; }
65
67
70 int GetObjectId() { return m_objectId; }
71
73
76 int GetGenerationId() { return m_generationId; }
77
78private:
79 wxPdfObjectType m_type;
80 int m_objectId;
81 int m_generationId;
82};
83
86class WXDLLIMPEXP_PDFDOC wxPdfAnnotationObject : public wxPdfIndirectObject
87{
88public:
90
94 wxPdfAnnotationObject(int objectId, int generationId);
95
98
100
106 void SetRectangle(double x, double y, double width, double height);
107
109
112 double GetX() { return m_x; }
113
115
118 double GetY() { return m_y; }
119
121
124 double GetWidth() { return m_w; }
125
127
130 double GetHeight() { return m_h; }
131
132private:
133 double m_x;
134 double m_y;
135 double m_w;
136 double m_h;
137};
138
141class WXDLLIMPEXP_PDFDOC wxPdfAnnotationWidget : public wxPdfAnnotationObject
142{
143public:
145
149 wxPdfAnnotationWidget(int objectId, int generationId = 0);
150
152 virtual ~wxPdfAnnotationWidget();
153
155
158 void SetName(const wxString& name) { m_name = name; }
159
161
164 wxString GetName() { return m_name; }
165
167
170 void SetBorderColour(const wxString& borderColour) { m_borderColour = borderColour; }
171
173
176 wxString GetBorderColour() { return m_borderColour; }
177
179
182 void SetBackgroundColour(const wxString& backgroundColour) { m_backgroundColour = backgroundColour; }
183
185
188 wxString GetBackgroundColour() { return m_backgroundColour; }
189
191
194 void SetTextColour(const wxString& textColour) { m_textColour = textColour; }
195
197
200 wxString GetTextColour() { return m_textColour; }
201
203
206 void SetBorderStyle(const wxString& borderStyle) { m_borderStyle = borderStyle; }
207
209
212 wxString GetBorderStyle() { return m_borderStyle; }
213
215
218 void SetBorderWidth(double borderWidth) { m_borderWidth = borderWidth; }
219
221
224 double GetBorderWidth() { return m_borderWidth; }
225
226private:
227 wxString m_name;
228 wxString m_borderColour;
229 wxString m_backgroundColour;
230 wxString m_textColour;
231 double m_borderWidth;
232 wxString m_borderStyle;
233};
234
237class WXDLLIMPEXP_PDFDOC wxPdfCheckBox : public wxPdfAnnotationWidget
238{
239public:
241
245 wxPdfCheckBox(int objectId, int generationId = 0);
246
248 virtual ~wxPdfCheckBox();
249
251
254 void SetValue(bool checked) { m_checked = checked; }
255
257
260 bool GetValue() { return m_checked; }
261
262private:
263 bool m_checked;
264};
265
268class WXDLLIMPEXP_PDFDOC wxPdfComboBox : public wxPdfAnnotationWidget
269{
270public:
272
278 wxPdfComboBox(int objectId,
279 int fontindex, double fontsize,
280 int generationId = 0);
281
283 virtual ~wxPdfComboBox();
284
286
289 void SetValue(const wxArrayString& values) { m_values = values; }
290
292
295 wxArrayString GetValue() { return m_values; }
296
298
301 int GetFontIndex() { return m_fontindex; }
302
304
307 double GetFontSize() { return m_fontsize; }
308
309private:
310 int m_fontindex;
311 double m_fontsize;
312 wxArrayString m_values;
313};
314
317class WXDLLIMPEXP_PDFDOC wxPdfPushButton : public wxPdfAnnotationWidget
318{
319public:
321
327 wxPdfPushButton(int objectId,
328 int fontindex, double fontsize,
329 int generationId = 0);
330
332 virtual ~wxPdfPushButton();
333
335
338 void SetCaption(const wxString& caption) { m_caption = caption; }
339
341
344 wxString GetCaption() { return m_caption; }
345
347
350 void SetAction(const wxString& action) { m_action = action; }
351
353
356 wxString GetAction() { return m_action; }
357
359
362 int GetFontIndex() { return m_fontindex; }
363
365
368 double GetFontSize() { return m_fontsize; }
369
370private:
371 int m_fontindex;
372 double m_fontsize;
373 wxString m_caption;
374 wxString m_action;
375};
376
377// Forward declaration of radio button group
378class WXDLLIMPEXP_FWD_PDFDOC wxPdfRadioGroup;
379
382class WXDLLIMPEXP_PDFDOC wxPdfRadioButton : public wxPdfAnnotationWidget
383{
384public:
386
391 wxPdfRadioButton(int objectId, int index, int generationId = 0);
392
394 virtual ~wxPdfRadioButton();
395
397
400 void SetParent(wxPdfRadioGroup* parent) { m_parent = parent; }
401
403
406 wxPdfRadioGroup* GetParent() { return m_parent; }
407
409
412 int GetIndex() { return m_index; }
413
414private:
415 wxPdfRadioGroup* m_parent;
416 int m_index;
417};
418
421class WXDLLIMPEXP_PDFDOC wxPdfRadioGroup : public wxPdfIndirectObject
422{
423public:
425
430 wxPdfRadioGroup(int objectId, const wxString& groupName, int generationId = 0);
431
433 virtual ~wxPdfRadioGroup();
434
436
439 void Add(wxPdfRadioButton* radio);
440
442
445 wxString GetName() { return m_groupName; }
446
448
451 unsigned int GetCount() { return (unsigned int) m_radios.GetCount(); }
452
454
457 wxArrayPtrVoid GetKids() { return m_radios; }
458
459private:
460 wxString m_groupName;
461 wxArrayPtrVoid m_radios; //< array of all radio buttons in this group
462};
463
466class WXDLLIMPEXP_PDFDOC wxPdfTextField : public wxPdfAnnotationWidget
467{
468public:
470
477 wxPdfTextField(int objectId,
478 int fontindex, double fontsize,
479 const wxString& value, int generation_id = 0);
480
482 virtual ~wxPdfTextField();
483
485
488 void SetValue(const wxString& value) { m_value = value; }
489
491
494 wxString GetValue() { return m_value; }
495
497
500 void SetMultiLine(bool multiline) { m_multiline = multiline; }
501
503
506 bool GetMultiLine() { return m_multiline; }
507
509
512 int GetFontIndex() { return m_fontindex; }
513
515
518 double GetFontSize() { return m_fontsize; }
519
520private:
521 int m_fontindex;
522 double m_fontsize;
523 wxString m_value;
524 bool m_multiline;
525};
526
527#endif
Base class for annotation objects (for internal use only)
Definition: pdfform.h:87
double GetHeight()
Get the height.
Definition: pdfform.h:130
double GetWidth()
Get the width.
Definition: pdfform.h:124
double GetX()
Get the X offset.
Definition: pdfform.h:112
double GetY()
Get the Y offset.
Definition: pdfform.h:118
Base class for PDF form fields (for internal use only)
Definition: pdfform.h:142
wxString GetName()
Get form field name.
Definition: pdfform.h:164
wxString GetBackgroundColour()
Get background colour representation of form field.
Definition: pdfform.h:188
wxString GetTextColour()
Get text colour representation of form field.
Definition: pdfform.h:200
void SetBorderStyle(const wxString &borderStyle)
Set border style of form field.
Definition: pdfform.h:206
void SetBorderWidth(double borderWidth)
Set border width of form field.
Definition: pdfform.h:218
void SetBorderColour(const wxString &borderColour)
Set border colour representation of form field.
Definition: pdfform.h:170
void SetName(const wxString &name)
Set form field name.
Definition: pdfform.h:158
wxString GetBorderStyle()
Get border style of form field.
Definition: pdfform.h:212
double GetBorderWidth()
Get border width of form field.
Definition: pdfform.h:224
wxString GetBorderColour()
Get border colour representation of form field.
Definition: pdfform.h:176
void SetTextColour(const wxString &textColour)
Set text colour representation of form field.
Definition: pdfform.h:194
void SetBackgroundColour(const wxString &backgroundColour)
Set background colour representation of form field.
Definition: pdfform.h:182
Class representing check box form fields (for internal use only)
Definition: pdfform.h:238
bool GetValue()
Get status of form field (checked/unchecked)
Definition: pdfform.h:260
void SetValue(bool checked)
Set status of form field (checked/unchecked)
Definition: pdfform.h:254
Class representing combo box form field (for internal use only)
Definition: pdfform.h:269
int GetFontIndex()
Get object index of font used for displaying the value list.
Definition: pdfform.h:301
double GetFontSize()
Get size of font used for displaying the value list.
Definition: pdfform.h:307
wxArrayString GetValue()
Get value list of combo box.
Definition: pdfform.h:295
void SetValue(const wxArrayString &values)
Set value list of combo box.
Definition: pdfform.h:289
Base class for indirect PDF objects (for internal use only)
Definition: pdfform.h:42
void SetType(wxPdfObjectType type)
Set type of object.
Definition: pdfform.h:64
wxPdfObjectType GetType()
Get type of this object.
Definition: pdfform.h:58
int GetObjectId()
Get identifier of this object.
Definition: pdfform.h:70
int GetGenerationId()
Get generation identifier of this object.
Definition: pdfform.h:76
Class representing push button form field (for internal use only)
Definition: pdfform.h:318
int GetFontIndex()
Get object index of font used for displaying the value list.
Definition: pdfform.h:362
void SetCaption(const wxString &caption)
Set caption string of button.
Definition: pdfform.h:338
wxString GetCaption()
Get caption string of button.
Definition: pdfform.h:344
void SetAction(const wxString &action)
Set JavaScript action associated with the button.
Definition: pdfform.h:350
wxString GetAction()
Get JavaScript action associated with the button.
Definition: pdfform.h:356
double GetFontSize()
Get size of font used for displaying the value list.
Definition: pdfform.h:368
Class representing radio button form field (for internal use only)
Definition: pdfform.h:383
void SetParent(wxPdfRadioGroup *parent)
Set parent (radio button group) of this button.
Definition: pdfform.h:400
int GetIndex()
Get index of this button within the radio button group.
Definition: pdfform.h:412
wxPdfRadioGroup * GetParent()
Get parent (radio button group) of this button.
Definition: pdfform.h:406
Class representing radio button groups (for internal use only)
Definition: pdfform.h:422
wxArrayPtrVoid GetKids()
Get the array of buttons in the group.
Definition: pdfform.h:457
wxString GetName()
Get name of the button group.
Definition: pdfform.h:445
unsigned int GetCount()
Get the number of buttons in the group.
Definition: pdfform.h:451
Class representing text form fields (for internal use only)
Definition: pdfform.h:467
double GetFontSize()
Get size of font used for displaying the value list.
Definition: pdfform.h:518
wxString GetValue()
Get default value of the text field.
Definition: pdfform.h:494
void SetValue(const wxString &value)
Set default value of the text field.
Definition: pdfform.h:488
void SetMultiLine(bool multiline)
Set multi line property of the text field.
Definition: pdfform.h:500
bool GetMultiLine()
Get multi line property of the text field.
Definition: pdfform.h:506
int GetFontIndex()
Get object index of font used for displaying the value list.
Definition: pdfform.h:512
Compile time switches for the wxPdfDocument component.
wxPdfObjectType
Object types.
Definition: pdfform.h:24