Scribus
Open source desktop publishing at your fingertips
annotation.h
1 /*
2 For general Scribus (>=1.3.2) copyright and licensing information please refer
3 to the COPYING file provided with the program. Following this notice may exist
4 a copyright and/or license notice that predates the release of Scribus 1.3.2
5 for which a new license (GPL+exception) is in place.
6 */
7 /***************************************************************************
8  begin : 2005
9  copyright : (C) 2005 by Craig Bradney
10  email : cbradney@zip.com.au
11 ***************************************************************************/
12 
13 /***************************************************************************
14 * *
15 * This program is free software; you can redistribute it and/or modify *
16 * it under the terms of the GNU General Public License as published by *
17 * the Free Software Foundation; either version 2 of the License, or *
18 * (at your option) any later version. *
19 * *
20 ***************************************************************************/
21 
22 #ifndef ANNOTATION_H
23 #define ANNOTATION_H
24 
25 #ifdef HAVE_CONFIG_H
26 #include "scconfig.h"
27 #endif
28 
29 #include <QString>
30 #include "scribusapi.h"
31 
32 //FIXME: Someone please fix these variable names..
33 //They are simply moved here, not all fixed.
34 //TODO make the usage in various places a little simpler
35 class SCRIBUS_API Annotation // : public SaxIO
36 {
37  public:
38  //Do we need a null or an empty QString for these? Remove the qstring initialisations if null is ok.
39  Annotation() : AnType(0), AnActType(0), AnAction(""), An_E_act(""), An_X_act(""), An_D_act(""),
40  An_Fo_act(""), An_Bl_act(""), An_K_act(""), An_F_act(""), An_V_act(""), An_C_act(""),
41  AnToolTip(""), AnRollOver(""), AnDown(""), AnBColor(""), An_Extern(""), AnBsty(0),
42  AnBwid(1), AnFeed(1), AnZiel(0), AnFlag(0), AnMaxChar(-1), AnVis(0), AnChkStil(0),
43  AnFont(4), AnIsChk(false), AnAAact(false), AnHTML(0), AnUseIcons(false),
44  AnIPlace(1), AnScaleW(0), AnFormat(0), tmp_Chk(false), on_State(false), is_Open(false), AnIcon(0), AnIsOpen(false)
45  {
46  }
47  enum AnnotationType
48  {
49  Button = 2,
50  Textfield = 3,
51  Checkbox = 4,
52  Combobox = 5,
53  Listbox = 6,
54  Text = 10,
55  Link = 11,
56  Annot3D = 12,
57  RadioButton = 13
58  };
59  enum AnnotationAction
60  {
61  Action_None = 0,
62  Action_JavaScript = 1,
63  Action_GoTo = 2,
64  Action_SubmitForm = 3,
65  Action_ResetForm = 4,
66  Action_ImportData = 5,
67  Action_GoToR_FileRel = 7,
68  Action_URI = 8,
69  Action_GoToR_FileAbs = 9,
70  Action_Named = 10
71  };
72  enum AnnotationScriptEvents
73  {
74  Java_ReleaseButton = 0,
75  Java_PressButton = 1,
76  Java_EnterWidget = 2,
77  Java_LeaveWidget = 3,
78  Java_FocusIn = 4,
79  Java_FocusOut = 5,
80  Java_SelectionChg = 6,
81  Java_FieldFormat = 7,
82  Java_FieldValidate = 8,
83  Java_FieldCalculate = 9
84  };
85  enum AnnotationIconType
86  {
87  Icon_Note = 0,
88  Icon_Comment = 1,
89  Icon_Key = 2,
90  Icon_Help = 3,
91  Icon_NewParagraph = 4,
92  Icon_Paragraph = 5,
93  Icon_Insert = 6,
94  Icon_Cross = 7,
95  Icon_Circle = 8
96  };
97  enum AnnotationFlags
98  {
99  Flag_ReadOnly = 1, // Bit 1
100  Flag_Required = 2, // Bit 2
101  Flag_NoExport = 4, // Bit 3
102  Flag_Multiline = 4096, // Bit 13
103  Flag_Password = 8192, // Bit 14
104  Flag_NoToggleToOff = 16384, // Bit 15
105  Flag_Radio = 32768, // Bit 16
106  Flag_PushButton = 65536, // Bit 17
107  Flag_Combo = 131072, // Bit 18
108  Flag_Edit = 262144, // Bit 19
109  Flag_Sort = 524288, // Bit 20
110  Flag_FileSelect = 1048576, // Bit 21
111  Flag_MultiSelect = 2097152, // Bit 22
112  Flag_DoNotSpellCheck = 4194304, // Bit 23
113  Flag_DoNotScroll = 8388608, // Bit 24
114  Flag_Comb = 16777216, // Bit 25
115  Flag_RichText = 33554432, // Bit 26 for Textfields only
116  Flag_RadiosInUnison = 33554432, // Bit 26 for Radio Buttons only
117  Flag_CommitOnSelChange = 67108864 // Bit 27
118  };
119 
120  void setType(int newType) { AnType=newType; }
121  void setAction(const QString& newAction) { AnAction=newAction; }
122  void setE_act(const QString& newE_act) { An_E_act=newE_act; }
123  void setX_act(const QString& newX_act) { An_X_act=newX_act; }
124  void setD_act(const QString& newD_act) { An_D_act=newD_act; }
125  void setFo_act(const QString& newFo_act) { An_Fo_act=newFo_act; }
126  void setBl_act(const QString& newBl_act) { An_Bl_act=newBl_act; }
127  void setK_act(const QString& newK_act) { An_K_act=newK_act; }
128  void setF_act(const QString& newF_act) { An_F_act=newF_act; }
129  void setV_act(const QString& newV_act) { An_V_act=newV_act; }
130  void setC_act(const QString& newC_act) { An_C_act=newC_act; }
131  void setExtern(const QString& newExtern) { An_Extern=newExtern; }
132  void setZiel(int newZiel) { AnZiel=newZiel; }
133  void setActionType(int newActType) { AnActType=newActType; }
134  void setToolTip(const QString& newToolTip) { AnToolTip=newToolTip; }
135  void setRollOver(const QString& newRollOver) { AnRollOver=newRollOver; }
136  void setDown(const QString& newDown) { AnDown=newDown; }
137  void setBorderColor(const QString& newBorderColor) { AnBColor=newBorderColor; }
138  void setBwid(int newBwid) { AnBwid=newBwid; }
139  void setBsty(int newBsty) { AnBsty=newBsty; }
140  void setFeed(int newFeed) { AnFeed=newFeed; }
141  void setFlag(int newFlag) { AnFlag=newFlag; }
142  void addToFlag(int dFlag) { AnFlag+=dFlag; }
143  void setMaxChar(int newMaxChar) { AnMaxChar=newMaxChar; }
144  void setVis(int newVis) { AnVis=newVis; }
145  void setFont(int newFont) { AnFont=newFont; }
146  void setChkStil(int newChkStil) { AnChkStil=newChkStil; }
147  void setFormat(int newFormat) { AnFormat=newFormat; }
148  void setIsChk(bool newIsChk) { AnIsChk=newIsChk; }
149  void setCheckState(bool newIsChk) { tmp_Chk=newIsChk; }
150  void setOpen(bool newIsOpen) { is_Open=newIsOpen; }
151  void setOnState(bool newIsChk) { on_State=newIsChk; }
152  void setAAact(bool newAAct) { AnAAact=newAAct; }
153  void setHTML(int newHTML) { AnHTML=newHTML; }
154  void setUseIcons(bool newUseIcons) { AnUseIcons=newUseIcons; }
155  void setIPlace(int newIPlace) { AnIPlace=newIPlace; }
156  void setScaleW(int newScaleW) { AnScaleW=newScaleW; }
157  void setAnOpen(bool newIsOpen) { AnIsOpen = newIsOpen; }
158  void setIcon(int newHTML) { AnIcon = newHTML; }
159 
160  int Type() const { return AnType; }
161  QString Action() const { return AnAction; }
162  QString E_act() const { return An_E_act; }
163  QString X_act() const { return An_X_act; }
164  QString D_act() const { return An_D_act; }
165  QString Fo_act() const { return An_Fo_act; }
166  QString Bl_act() const { return An_Bl_act; }
167  QString K_act() const { return An_K_act; }
168  QString F_act() const { return An_F_act; }
169  QString V_act() const { return An_V_act; }
170  QString C_act() const { return An_C_act; }
171  QString Extern() const { return An_Extern; }
172  int Ziel() const { return AnZiel; }
173  int ActionType() const { return AnActType; }
174  QString ToolTip() const { return AnToolTip; }
175  QString RollOver() const { return AnRollOver; }
176  QString Down() const { return AnDown; }
177  QString borderColor() const { return AnBColor; }
178  int Bwid() const { return AnBwid; }
179  int Bsty() const { return AnBsty; }
180  int Feed() const { return AnFeed; }
181  int Flag() const { return AnFlag; }
182  int MaxChar() const { return AnMaxChar; }
183  int Vis() const { return AnVis; }
184  int Font() const { return AnFont; }
185  int ChkStil() const { return AnChkStil; }
186  int Format() const { return AnFormat; }
187  bool IsChk() const { return AnIsChk; }
188  bool IsChecked() const { return tmp_Chk; }
189  bool IsOpen() const { return is_Open; }
190  bool IsOn() const { return on_State; }
191  bool AAact() const { return AnAAact; }
192  int HTML() const { return AnHTML; }
193  bool UseIcons() const { return AnUseIcons; }
194  int IPlace() const { return AnIPlace; }
195  int ScaleW() const { return AnScaleW; }
196  bool IsAnOpen() const { return AnIsOpen; }
197  int Icon() const { return AnIcon; }
198 
199  protected:
200  int AnType;
201  int AnActType;
202  QString AnAction;
203  QString An_E_act;
204  QString An_X_act;
205  QString An_D_act;
206  QString An_Fo_act;
207  QString An_Bl_act;
208  QString An_K_act;
209  QString An_F_act;
210  QString An_V_act;
211  QString An_C_act;
212  QString AnToolTip;
213  QString AnRollOver;
214  QString AnDown;
215  QString AnBColor;
216  QString An_Extern;
217  int AnBsty;
218  int AnBwid;
219  int AnFeed;
220  int AnZiel;
221  int AnFlag;
222  int AnMaxChar;
223  int AnVis;
224  int AnChkStil;
225  int AnFont;
226  bool AnIsChk;
227  bool AnAAact;
228  int AnHTML;
229  bool AnUseIcons;
230  int AnIPlace;
231  int AnScaleW;
232  int AnFormat;
233  bool tmp_Chk;
234  bool on_State;
235  bool is_Open;
236  int AnIcon;
237  bool AnIsOpen;
238 };
239 
240 #endif
Definition: annotation.h:35