Remove this line
[kdeaccessibility.git] / ksayit / src / docbookclasses.h
blobeef00064b1eeb568a5da70239f70791918c1bebd
1 //
2 // C++ Interface: docbookclasses.h
3 //
4 // Description:
5 //
6 //
7 // Author: Robert Vogl <voglrobe@lapislazuli>, (C) 2004
8 //
9 // Copyright: See COPYING file that comes with this distribution
12 #ifndef DOCBOOKCLASSES_H
13 #define DOCBOOKCLASSES_H
15 // Qt includes
16 #include <QtXml/qdom.h>
18 // KDE includes
19 #include <k3listview.h>
21 // App specific includes
22 #include "Types.h"
24 // forward declarations
27 // Classes for Roberts elements
29 /**
30 Represents the root item of the document, therefore it expects
31 a \p QListView object as parent.\n
32 Structural item only (no references to a DOM node).
33 @author Robert Vogl
35 class RobDocument : public ListViewInterface
37 public:
38 /**
39 * Constructor
40 * \param lv The ListView parent.
41 * \param label The label is shown in column 0 of the TreeView and is also
42 * used as bookmark title.
44 RobDocument(K3ListView *lv=0, QString label=QString());
45 ~RobDocument();
47 void setNodes( const NodeList_type &list ){m_list = list;};
48 void getNodes( NodeList_type &list ) const {list = m_list;};
49 QString getRTFHeader() const;
50 QString getHeader() const ;
51 QString getRTFData() const {return QString();};
52 QString getData() const {return QString();};
53 QString getRawData() const {return QString();};
54 void setData(const QString &, QDomDocument &) { /** structural element only */ };
55 void setEditable(bool editable) {m_iseditable = editable;};
56 bool isEditable() const {return m_iseditable;};
58 void deleteAction() {};
59 QString getXmlContextName() const {return "RobDocument";};
61 private:
62 NodeList_type m_list;
63 bool m_iseditable;
68 // Classes for Docbook elements
70 /**
71 Represents the DocBook \p Overview element of the document.\n
72 Structural item only (no references to a DOM node).
73 @author Robert Vogl
75 class Overview : public ListViewInterface
77 public:
78 Overview(ListViewInterface *parent=0, ListViewInterface *after=0, QString label=QString());
79 ~Overview();
81 void setNodes( const NodeList_type &list ){m_list = list;};
82 void getNodes( NodeList_type &list ) const {list = m_list;};
83 QString getRTFHeader() const;
84 QString getHeader() const;
85 QString getRTFData() const {return QString();};
86 QString getData() const {return QString();};
87 QString getRawData() const {return QString();};
88 void setData(const QString &, QDomDocument &) { /** structural element only */ };
89 void setEditable(bool editable) {m_iseditable = editable;};
90 bool isEditable() const {return m_iseditable;};
92 void deleteAction() {};
93 QString getXmlContextName() const {return "BookInfo";};
95 private:
96 NodeList_type m_list;
97 bool m_iseditable;
102 Represents the DocBook \p Date element of the document.\n
103 @author Robert Vogl
105 class Date : public ListViewInterface
107 public:
108 Date(ListViewInterface *parent=0, ListViewInterface *after=0, QString label=QString());
109 ~Date();
111 void setNodes( const NodeList_type &list );
112 void getNodes( NodeList_type &list ) const;
113 QString getRTFHeader() const;
114 QString getHeader() const;
115 QString getRTFData() const;
116 QString getData() const;
117 QString getRawData() const;
118 void setData(const QString &data, QDomDocument &);
119 void setEditable(bool editable) {m_iseditable = editable;};
120 bool isEditable() const {return m_iseditable;};
122 void deleteAction() {};
123 QString getXmlContextName() const {return "Date";};
125 private:
126 // Pointer to the associated Data
127 QDomNode m_node;
128 bool m_iseditable;
133 Represents the DocBook \p ReleasInfo element of the document.\n
134 @author Robert Vogl
136 class ReleaseInfo : public ListViewInterface
138 public:
139 ReleaseInfo(ListViewInterface *parent=0, ListViewInterface *after=0, QString label=QString());
140 ~ReleaseInfo();
142 void setNodes( const NodeList_type &list );
143 void getNodes( NodeList_type &list ) const;
144 QString getRTFHeader() const;
145 QString getHeader() const;
146 QString getRTFData() const;
147 QString getData() const;
148 QString getRawData() const;
149 void setData(const QString &data, QDomDocument &);
150 void setEditable(bool editable) {m_iseditable = editable;};
151 bool isEditable() const {return m_iseditable;};
153 void deleteAction() {};
154 QString getXmlContextName() const {return "ReleaseInfo";};
156 private:
157 // Pointer to the associated Data
158 QDomNode m_node;
159 bool m_iseditable;
164 Represents the DocBook \p AuthorGroup element of the document.\n
165 Structural item only (no references to a DOM node).
166 @author Robert Vogl
168 class AuthorGroup : public ListViewInterface
170 public:
171 AuthorGroup(ListViewInterface *parent=0, ListViewInterface *after=0, QString label=QString());
172 ~AuthorGroup();
174 void setNodes( const NodeList_type &list ){m_list = list;};
175 void getNodes( NodeList_type &list ) const {list = m_list;};
176 QString getRTFHeader() const;
177 QString getHeader() const;
178 QString getRTFData() const {return QString();};
179 QString getData() const {return QString();};
180 QString getRawData() const {return QString();};
181 void setData(const QString &, QDomDocument &) { /** structural element only */ };
182 void setEditable(bool editable) {m_iseditable = editable;};
183 bool isEditable() const {return m_iseditable;};
185 void deleteAction() {};
186 QString getXmlContextName() const {return "AuthorGroup";};
188 private:
189 NodeList_type m_list;
190 bool m_iseditable;
195 Represents the DocBook \p Author element and its Subelements
196 \p Firstname and \p Surname of the document.\n
197 @author Robert Vogl
199 class Author : public ListViewInterface
201 public:
202 Author(ListViewInterface *parent=0, ListViewInterface *after=0, QString label=QString());
203 ~Author();
206 * \param node1 = Firstname
207 * \param node2 = Surname
209 void setNodes( const NodeList_type &list );
210 void getNodes( NodeList_type &list ) const;
211 QString getRTFHeader() const;
212 QString getHeader() const;
213 QString getRTFData() const;
215 void deleteAction() {};
216 QString getXmlContextName() const {return "Author";};
219 * \returns Firstname + Space + Surname
221 QString getRawData() const;
224 * \returns Firstname + Space + Surname
226 QString getData() const;
229 * Expects firstname and surname sperated by one or more space characters
230 * and updates the corresponding DOM elements.
231 * \param A string in the form Firstname + Space + Surname
233 void setData(const QString &data, QDomDocument &);
234 void setEditable(bool editable) {m_iseditable = editable;};
235 bool isEditable() const {return m_iseditable;};
237 private:
238 // Pointer to the associated Data
239 QDomNode m_node1;
240 QDomNode m_node2;
241 bool m_iseditable;
246 Represents the DocBook \p KeywordSet element of the document.\n
247 Structural item only (no references to a DOM node).
248 @author Robert Vogl
250 class KeywordSet : public ListViewInterface
252 public:
253 KeywordSet(ListViewInterface *parent=0, ListViewInterface *after=0, QString label=QString());
254 ~KeywordSet();
256 void setNodes( const NodeList_type &list ){m_list = list;};
257 void getNodes( NodeList_type &list ) const {list = m_list;};
258 QString getRTFHeader() const;
259 QString getHeader() const;
260 QString getRTFData() const {return QString();};
261 QString getData() const {return QString();};
262 QString getRawData() const {return QString();};
263 void setData(const QString &, QDomDocument &) { /** structural element only */ };
264 void setEditable(bool editable) {m_iseditable = editable;};
265 bool isEditable() const {return m_iseditable;};
267 void deleteAction() {};
268 QString getXmlContextName() const {return "KeywordSet";};
270 private:
271 NodeList_type m_list;
272 bool m_iseditable;
277 Represents the DocBook \p Keyword element of the document.\n
278 @author Robert Vogl
280 class Keyword : public ListViewInterface
282 public:
283 Keyword(ListViewInterface *parent=0, ListViewInterface *after=0, QString label=QString());
284 ~Keyword();
286 void setNodes( const NodeList_type &list );
287 void getNodes( NodeList_type &list ) const;
288 QString getRTFHeader() const {return QString();};
289 QString getHeader() const {return QString();};
290 QString getRTFData() const;
291 QString getData() const;
292 QString getRawData() const;
293 void setData(const QString &data, QDomDocument &);
294 void setEditable(bool editable) {m_iseditable = editable;};
295 bool isEditable() const {return m_iseditable;};
297 void deleteAction() {};
298 QString getXmlContextName() const {return "Keyword";};
300 private:
301 // Pointer to the associated Data
302 QDomNode m_node;
303 bool m_iseditable;
308 Represents the DocBook \p Abstract element of the document.\n
309 Structural item only (no references to a DOM node).
310 @author Robert Vogl
312 class Abstract : public ListViewInterface
314 public:
315 Abstract(ListViewInterface *parent=0, ListViewInterface *after=0, QString label=QString());
316 ~Abstract();
318 void setNodes( const NodeList_type &list ){m_list = list;};
319 void getNodes( NodeList_type &list ) const {list = m_list;};
320 QString getRTFHeader() const;
321 QString getHeader() const;
322 QString getRTFData() const {return QString();};
323 QString getData() const {return QString();};
324 QString getRawData() const {return QString();};
325 void setData(const QString &, QDomDocument &) { /** structural element only */ };
326 void setEditable(bool editable) {m_iseditable = editable;};
327 bool isEditable() const {return m_iseditable;};
329 void deleteAction() {};
330 QString getXmlContextName() const {return "Abstract";};
332 private:
333 NodeList_type m_list;
334 bool m_iseditable;
339 Represents a DocBook Paragraph item of the document.\n
340 @author Robert Vogl
342 class Para : public ListViewInterface
344 public:
345 Para(ListViewInterface *parent=0, ListViewInterface *after=0, QString label=QString());
346 ~Para();
348 void setNodes( const NodeList_type &list );
349 void getNodes( NodeList_type &list ) const;
350 QString getRTFHeader() const;
351 QString getHeader() const;
352 QString getRTFData() const;
353 QString getData() const;
354 QString getRawData() const;
356 void deleteAction() { /** TODO */ };
357 QString getXmlContextName() const {return "Para";};
360 * Embedded XML elements are allowed.
361 * Checks if any embedded tags are consistent. If not, the data
362 * will be stored as \p CDATA.
363 * \param data The new content of a DocBook paragraph without
364 * opening and closing \p \<para\> ...\p \</para\> tags.\n
366 void setData(const QString &data, QDomDocument &);
367 void setEditable(bool editable) {m_iseditable = editable;};
368 bool isEditable() const {return m_iseditable;};
370 private:
371 // Pointer to the associated Data
372 QDomNode m_node;
373 bool m_iseditable;
378 Represents the DocBook \p Chapter element of the document.\n
379 Structural item only (no references to a DOM node).
380 @author Robert Vogl
382 class Chapter : public ListViewInterface
384 public:
385 Chapter(ListViewInterface *parent=0, ListViewInterface *after=0, QString label=QString());
386 ~Chapter();
388 void setNodes( const NodeList_type &list ){m_list = list;};
389 void getNodes( NodeList_type &list ) const {list = m_list;};
390 QString getRTFHeader() const;
391 QString getHeader() const;
392 QString getRTFData() const {return QString();};
393 QString getData() const {return QString();};
394 QString getRawData() const {return QString();};
395 void setData(const QString &, QDomDocument &) { /** structural element only */ };
396 void setEditable(bool editable) {m_iseditable = editable;};
397 bool isEditable() const {return m_iseditable;};
399 void deleteAction() { /** TODO */ };
400 QString getXmlContextName() const {return "Chapter";};
402 private:
403 // Pointer to the associated Data
404 NodeList_type m_list;
405 bool m_iseditable;
410 Represents the DocBook \p Sec1 element of the document.\n
411 Structural item only (no references to a DOM node).
412 @author Robert Vogl
414 class Sect1 : public ListViewInterface
416 public:
417 Sect1(ListViewInterface *parent=0, ListViewInterface *after=0, QString label=QString());
418 ~Sect1();
420 void setNodes( const NodeList_type &list ){m_list = list;};
421 void getNodes( NodeList_type &list ) const {list = m_list;};
422 QString getRTFHeader() const;
423 QString getHeader() const;
424 QString getRTFData() const {return QString();};
425 QString getData() const {return QString();};
426 QString getRawData() const {return QString();};
427 void setData(const QString &, QDomDocument &) { /** structural element only */ };
428 void setEditable(bool editable) {m_iseditable = editable;};
429 bool isEditable() const {return m_iseditable;};
431 void deleteAction() { /** TODO */ };
432 QString getXmlContextName() const {return "Sect1";};
434 private:
435 // Pointer to the associated Data
436 NodeList_type m_list;
437 bool m_iseditable;
442 Represents the DocBook \p Sec2 element of the document.\n
443 Structural item only (no references to a DOM node).
444 @author Robert Vogl
446 class Sect2 : public ListViewInterface
448 public:
449 Sect2(ListViewInterface *parent=0, ListViewInterface *after=0, QString label=QString());
450 ~Sect2();
452 void setNodes( const NodeList_type &list ){m_list = list;};
453 void getNodes( NodeList_type &list ) const {list = m_list;};
454 QString getRTFHeader() const;
455 QString getHeader() const;
456 QString getRTFData() const {return QString();};
457 QString getData() const {return QString();};
458 QString getRawData() const {return QString();};
459 void setData(const QString &, QDomDocument &) { /** structural element only */ };
460 void setEditable(bool editable) {m_iseditable = editable;};
461 bool isEditable() const {return m_iseditable;};
463 void deleteAction() { /** TODO */ };
464 QString getXmlContextName() const {return "Sect2";};
466 private:
467 // Pointer to the associated Data
468 NodeList_type m_list;
469 bool m_iseditable;
474 Represents the DocBook \p Sec3 element of the document.\n
475 Structural item only (no references to a DOM node).
476 @author Robert Vogl
478 class Sect3 : public ListViewInterface
480 public:
481 Sect3(ListViewInterface *parent=0, ListViewInterface *after=0, QString label=QString());
482 ~Sect3();
484 void setNodes( const NodeList_type &list ){m_list = list;};
485 void getNodes( NodeList_type &list ) const {list = m_list;};
486 QString getRTFHeader() const;
487 QString getHeader() const;
488 QString getRTFData() const {return QString();};
489 QString getData() const {return QString();};
490 QString getRawData() const {return QString();};
491 void setData(const QString &, QDomDocument &) { /** structural element only */ };
492 void setEditable(bool editable) {m_iseditable = editable;};
493 bool isEditable() const {return m_iseditable;};
495 void deleteAction() { /** TODO */ };
496 QString getXmlContextName() const {return "Sect3";};
498 private:
499 // Pointer to the associated Data
500 NodeList_type m_list;
501 bool m_iseditable;
506 Represents the DocBook \p Sec4 element of the document.\n
507 Structural item only (no references to a DOM node).
508 @author Robert Vogl
510 class Sect4 : public ListViewInterface
512 public:
513 Sect4(ListViewInterface *parent=0, ListViewInterface *after=0, QString label=QString());
514 ~Sect4();
516 void setNodes( const NodeList_type &list ){m_list = list;};
517 void getNodes( NodeList_type &list ) const {list = m_list;};
518 QString getRTFHeader() const;
519 QString getHeader() const;
520 QString getRTFData() const {return QString();};
521 QString getData() const {return QString();};
522 QString getRawData() const {return QString();};
523 void setData(const QString &, QDomDocument &) { /** structural element only */ };
524 void setEditable(bool editable) {m_iseditable = editable;};
525 bool isEditable() const {return m_iseditable;};
527 void deleteAction() { /** TODO */ };
528 QString getXmlContextName() const {return "Sect4";};
530 private:
531 // Pointer to the associated Data
532 NodeList_type m_list;
533 bool m_iseditable;
538 Represents the DocBook \p Sec5 element of the document.\n
539 Structural item only (no references to a DOM node).
540 @author Robert Vogl
542 class Sect5 : public ListViewInterface
544 public:
545 Sect5(ListViewInterface *parent=0, ListViewInterface *after=0, QString label=QString());
546 ~Sect5();
548 void setNodes( const NodeList_type &list ){m_list = list;};
549 void getNodes( NodeList_type &list ) const {list = m_list;};
550 QString getRTFHeader() const;
551 QString getHeader() const;
552 QString getRTFData() const {return QString();};
553 QString getData() const {return QString();};
554 QString getRawData() const {return QString();};
555 void setData(const QString &, QDomDocument &) { /** structural element only */ };
556 void setEditable(bool editable) {m_iseditable = editable;};
557 bool isEditable() const {return m_iseditable;};
559 void deleteAction() { /** TODO */ };
560 QString getXmlContextName() const {return "Sect5";};
562 private:
563 // Pointer to the associated Data
564 NodeList_type m_list;
565 bool m_iseditable;
568 #endif