SVN_SILENT made messages (.desktop file)
[kdeaccessibility.git] / ksayit / src / docbookclasses.h
blob3b33cea74ce526195f678b565b3f353e18fd9e85
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 <QString>
17 #include <qdom.h>
19 // KDE includes
20 #include <k3listview.h>
22 // App specific includes
23 #include "Types.h"
25 // forward declarations
26 class QStringList;
29 // Classes for Roberts elements
31 /**
32 Represents the root item of the document, therefore it expects
33 a \p QListView object as parent.\n
34 Structural item only (no references to a DOM node).
35 @author Robert Vogl
37 class RobDocument : public ListViewInterface
39 public:
40 /**
41 * Constructor
42 * \param lv The ListView parent.
43 * \param label The label is shown in column 0 of the TreeView and is also
44 * used as bookmark title.
46 RobDocument(K3ListView *lv=0, QString label=QString());
47 ~RobDocument();
49 void setNodes( const NodeList_type &list ){m_list = list;};
50 void getNodes( NodeList_type &list ) const {list = m_list;};
51 QString getRTFHeader() const;
52 QString getHeader() const ;
53 QString getRTFData() const {return QString();};
54 QString getData() const {return QString();};
55 QString getRawData() const {return QString();};
56 void setData(const QString &, QDomDocument &) { /** structural element only */ };
57 void setEditable(bool editable) {m_iseditable = editable;};
58 bool isEditable() const {return m_iseditable;};
60 void deleteAction() {};
61 QString getXmlContextName() const {return "RobDocument";};
63 private:
64 NodeList_type m_list;
65 bool m_iseditable;
70 // Classes for Docbook elements
72 /**
73 Represents the DocBook \p Overview element of the document.\n
74 Structural item only (no references to a DOM node).
75 @author Robert Vogl
77 class Overview : public ListViewInterface
79 public:
80 Overview(ListViewInterface *parent=0, ListViewInterface *after=0, QString label=QString());
81 ~Overview();
83 void setNodes( const NodeList_type &list ){m_list = list;};
84 void getNodes( NodeList_type &list ) const {list = m_list;};
85 QString getRTFHeader() const;
86 QString getHeader() const;
87 QString getRTFData() const {return QString();};
88 QString getData() const {return QString();};
89 QString getRawData() const {return QString();};
90 void setData(const QString &, QDomDocument &) { /** structural element only */ };
91 void setEditable(bool editable) {m_iseditable = editable;};
92 bool isEditable() const {return m_iseditable;};
94 void deleteAction() {};
95 QString getXmlContextName() const {return "BookInfo";};
97 private:
98 NodeList_type m_list;
99 bool m_iseditable;
104 Represents the DocBook \p Date element of the document.\n
105 @author Robert Vogl
107 class Date : public ListViewInterface
109 public:
110 Date(ListViewInterface *parent=0, ListViewInterface *after=0, QString label=QString());
111 ~Date();
113 void setNodes( const NodeList_type &list );
114 void getNodes( NodeList_type &list ) const;
115 QString getRTFHeader() const;
116 QString getHeader() const;
117 QString getRTFData() const;
118 QString getData() const;
119 QString getRawData() const;
120 void setData(const QString &data, QDomDocument &);
121 void setEditable(bool editable) {m_iseditable = editable;};
122 bool isEditable() const {return m_iseditable;};
124 void deleteAction() {};
125 QString getXmlContextName() const {return "Date";};
127 private:
128 // Pointer to the associated Data
129 QDomNode m_node;
130 bool m_iseditable;
135 Represents the DocBook \p ReleasInfo element of the document.\n
136 @author Robert Vogl
138 class ReleaseInfo : public ListViewInterface
140 public:
141 ReleaseInfo(ListViewInterface *parent=0, ListViewInterface *after=0, QString label=QString());
142 ~ReleaseInfo();
144 void setNodes( const NodeList_type &list );
145 void getNodes( NodeList_type &list ) const;
146 QString getRTFHeader() const;
147 QString getHeader() const;
148 QString getRTFData() const;
149 QString getData() const;
150 QString getRawData() const;
151 void setData(const QString &data, QDomDocument &);
152 void setEditable(bool editable) {m_iseditable = editable;};
153 bool isEditable() const {return m_iseditable;};
155 void deleteAction() {};
156 QString getXmlContextName() const {return "ReleaseInfo";};
158 private:
159 // Pointer to the associated Data
160 QDomNode m_node;
161 bool m_iseditable;
166 Represents the DocBook \p AuthorGroup element of the document.\n
167 Structural item only (no references to a DOM node).
168 @author Robert Vogl
170 class AuthorGroup : public ListViewInterface
172 public:
173 AuthorGroup(ListViewInterface *parent=0, ListViewInterface *after=0, QString label=QString());
174 ~AuthorGroup();
176 void setNodes( const NodeList_type &list ){m_list = list;};
177 void getNodes( NodeList_type &list ) const {list = m_list;};
178 QString getRTFHeader() const;
179 QString getHeader() const;
180 QString getRTFData() const {return QString();};
181 QString getData() const {return QString();};
182 QString getRawData() const {return QString();};
183 void setData(const QString &, QDomDocument &) { /** structural element only */ };
184 void setEditable(bool editable) {m_iseditable = editable;};
185 bool isEditable() const {return m_iseditable;};
187 void deleteAction() {};
188 QString getXmlContextName() const {return "AuthorGroup";};
190 private:
191 NodeList_type m_list;
192 bool m_iseditable;
197 Represents the DocBook \p Author element and its Subelements
198 \p Firstname and \p Surname of the document.\n
199 @author Robert Vogl
201 class Author : public ListViewInterface
203 public:
204 Author(ListViewInterface *parent=0, ListViewInterface *after=0, QString label=QString());
205 ~Author();
208 * \param node1 = Firstname
209 * \param node2 = Surname
211 void setNodes( const NodeList_type &list );
212 void getNodes( NodeList_type &list ) const;
213 QString getRTFHeader() const;
214 QString getHeader() const;
215 QString getRTFData() const;
217 void deleteAction() {};
218 QString getXmlContextName() const {return "Author";};
221 * \returns Firstname + Space + Surname
223 QString getRawData() const;
226 * \returns Firstname + Space + Surname
228 QString getData() const;
231 * Expects firstname and surname sperated by one or more space characters
232 * and updates the corresponding DOM elements.
233 * \param A string in the form Firstname + Space + Surname
235 void setData(const QString &data, QDomDocument &);
236 void setEditable(bool editable) {m_iseditable = editable;};
237 bool isEditable() const {return m_iseditable;};
239 private:
240 // Pointer to the associated Data
241 QDomNode m_node1;
242 QDomNode m_node2;
243 bool m_iseditable;
248 Represents the DocBook \p KeywordSet element of the document.\n
249 Structural item only (no references to a DOM node).
250 @author Robert Vogl
252 class KeywordSet : public ListViewInterface
254 public:
255 KeywordSet(ListViewInterface *parent=0, ListViewInterface *after=0, QString label=QString());
256 ~KeywordSet();
258 void setNodes( const NodeList_type &list ){m_list = list;};
259 void getNodes( NodeList_type &list ) const {list = m_list;};
260 QString getRTFHeader() const;
261 QString getHeader() const;
262 QString getRTFData() const {return QString();};
263 QString getData() const {return QString();};
264 QString getRawData() const {return QString();};
265 void setData(const QString &, QDomDocument &) { /** structural element only */ };
266 void setEditable(bool editable) {m_iseditable = editable;};
267 bool isEditable() const {return m_iseditable;};
269 void deleteAction() {};
270 QString getXmlContextName() const {return "KeywordSet";};
272 private:
273 NodeList_type m_list;
274 bool m_iseditable;
279 Represents the DocBook \p Keyword element of the document.\n
280 @author Robert Vogl
282 class Keyword : public ListViewInterface
284 public:
285 Keyword(ListViewInterface *parent=0, ListViewInterface *after=0, QString label=QString());
286 ~Keyword();
288 void setNodes( const NodeList_type &list );
289 void getNodes( NodeList_type &list ) const;
290 QString getRTFHeader() const {return QString();};
291 QString getHeader() const {return QString();};
292 QString getRTFData() const;
293 QString getData() const;
294 QString getRawData() const;
295 void setData(const QString &data, QDomDocument &);
296 void setEditable(bool editable) {m_iseditable = editable;};
297 bool isEditable() const {return m_iseditable;};
299 void deleteAction() {};
300 QString getXmlContextName() const {return "Keyword";};
302 private:
303 // Pointer to the associated Data
304 QDomNode m_node;
305 bool m_iseditable;
310 Represents the DocBook \p Abstract element of the document.\n
311 Structural item only (no references to a DOM node).
312 @author Robert Vogl
314 class Abstract : public ListViewInterface
316 public:
317 Abstract(ListViewInterface *parent=0, ListViewInterface *after=0, QString label=QString());
318 ~Abstract();
320 void setNodes( const NodeList_type &list ){m_list = list;};
321 void getNodes( NodeList_type &list ) const {list = m_list;};
322 QString getRTFHeader() const;
323 QString getHeader() const;
324 QString getRTFData() const {return QString();};
325 QString getData() const {return QString();};
326 QString getRawData() const {return QString();};
327 void setData(const QString &, QDomDocument &) { /** structural element only */ };
328 void setEditable(bool editable) {m_iseditable = editable;};
329 bool isEditable() const {return m_iseditable;};
331 void deleteAction() {};
332 QString getXmlContextName() const {return "Abstract";};
334 private:
335 NodeList_type m_list;
336 bool m_iseditable;
341 Represents a DocBook Paragraph item of the document.\n
342 @author Robert Vogl
344 class Para : public ListViewInterface
346 public:
347 Para(ListViewInterface *parent=0, ListViewInterface *after=0, QString label=QString());
348 ~Para();
350 void setNodes( const NodeList_type &list );
351 void getNodes( NodeList_type &list ) const;
352 QString getRTFHeader() const;
353 QString getHeader() const;
354 QString getRTFData() const;
355 QString getData() const;
356 QString getRawData() const;
358 void deleteAction() { /** TODO */ };
359 QString getXmlContextName() const {return "Para";};
362 * Embedded XML elements are allowed.
363 * Checks if any embedded tags are consistent. If not, the data
364 * will be stored as \p CDATA.
365 * \param data The new content of a DocBook paragraph without
366 * opening and closing \p \<para\> ...\p \</para\> tags.\n
368 void setData(const QString &data, QDomDocument &);
369 void setEditable(bool editable) {m_iseditable = editable;};
370 bool isEditable() const {return m_iseditable;};
372 private:
373 // Pointer to the associated Data
374 QDomNode m_node;
375 bool m_iseditable;
380 Represents the DocBook \p Chapter element of the document.\n
381 Structural item only (no references to a DOM node).
382 @author Robert Vogl
384 class Chapter : public ListViewInterface
386 public:
387 Chapter(ListViewInterface *parent=0, ListViewInterface *after=0, QString label=QString());
388 ~Chapter();
390 void setNodes( const NodeList_type &list ){m_list = list;};
391 void getNodes( NodeList_type &list ) const {list = m_list;};
392 QString getRTFHeader() const;
393 QString getHeader() const;
394 QString getRTFData() const {return QString();};
395 QString getData() const {return QString();};
396 QString getRawData() const {return QString();};
397 void setData(const QString &, QDomDocument &) { /** structural element only */ };
398 void setEditable(bool editable) {m_iseditable = editable;};
399 bool isEditable() const {return m_iseditable;};
401 void deleteAction() { /** TODO */ };
402 QString getXmlContextName() const {return "Chapter";};
404 private:
405 // Pointer to the associated Data
406 NodeList_type m_list;
407 bool m_iseditable;
412 Represents the DocBook \p Sec1 element of the document.\n
413 Structural item only (no references to a DOM node).
414 @author Robert Vogl
416 class Sect1 : public ListViewInterface
418 public:
419 Sect1(ListViewInterface *parent=0, ListViewInterface *after=0, QString label=QString());
420 ~Sect1();
422 void setNodes( const NodeList_type &list ){m_list = list;};
423 void getNodes( NodeList_type &list ) const {list = m_list;};
424 QString getRTFHeader() const;
425 QString getHeader() const;
426 QString getRTFData() const {return QString();};
427 QString getData() const {return QString();};
428 QString getRawData() const {return QString();};
429 void setData(const QString &, QDomDocument &) { /** structural element only */ };
430 void setEditable(bool editable) {m_iseditable = editable;};
431 bool isEditable() const {return m_iseditable;};
433 void deleteAction() { /** TODO */ };
434 QString getXmlContextName() const {return "Sect1";};
436 private:
437 // Pointer to the associated Data
438 NodeList_type m_list;
439 bool m_iseditable;
444 Represents the DocBook \p Sec2 element of the document.\n
445 Structural item only (no references to a DOM node).
446 @author Robert Vogl
448 class Sect2 : public ListViewInterface
450 public:
451 Sect2(ListViewInterface *parent=0, ListViewInterface *after=0, QString label=QString());
452 ~Sect2();
454 void setNodes( const NodeList_type &list ){m_list = list;};
455 void getNodes( NodeList_type &list ) const {list = m_list;};
456 QString getRTFHeader() const;
457 QString getHeader() const;
458 QString getRTFData() const {return QString();};
459 QString getData() const {return QString();};
460 QString getRawData() const {return QString();};
461 void setData(const QString &, QDomDocument &) { /** structural element only */ };
462 void setEditable(bool editable) {m_iseditable = editable;};
463 bool isEditable() const {return m_iseditable;};
465 void deleteAction() { /** TODO */ };
466 QString getXmlContextName() const {return "Sect2";};
468 private:
469 // Pointer to the associated Data
470 NodeList_type m_list;
471 bool m_iseditable;
476 Represents the DocBook \p Sec3 element of the document.\n
477 Structural item only (no references to a DOM node).
478 @author Robert Vogl
480 class Sect3 : public ListViewInterface
482 public:
483 Sect3(ListViewInterface *parent=0, ListViewInterface *after=0, QString label=QString());
484 ~Sect3();
486 void setNodes( const NodeList_type &list ){m_list = list;};
487 void getNodes( NodeList_type &list ) const {list = m_list;};
488 QString getRTFHeader() const;
489 QString getHeader() const;
490 QString getRTFData() const {return QString();};
491 QString getData() const {return QString();};
492 QString getRawData() const {return QString();};
493 void setData(const QString &, QDomDocument &) { /** structural element only */ };
494 void setEditable(bool editable) {m_iseditable = editable;};
495 bool isEditable() const {return m_iseditable;};
497 void deleteAction() { /** TODO */ };
498 QString getXmlContextName() const {return "Sect3";};
500 private:
501 // Pointer to the associated Data
502 NodeList_type m_list;
503 bool m_iseditable;
508 Represents the DocBook \p Sec4 element of the document.\n
509 Structural item only (no references to a DOM node).
510 @author Robert Vogl
512 class Sect4 : public ListViewInterface
514 public:
515 Sect4(ListViewInterface *parent=0, ListViewInterface *after=0, QString label=QString());
516 ~Sect4();
518 void setNodes( const NodeList_type &list ){m_list = list;};
519 void getNodes( NodeList_type &list ) const {list = m_list;};
520 QString getRTFHeader() const;
521 QString getHeader() const;
522 QString getRTFData() const {return QString();};
523 QString getData() const {return QString();};
524 QString getRawData() const {return QString();};
525 void setData(const QString &, QDomDocument &) { /** structural element only */ };
526 void setEditable(bool editable) {m_iseditable = editable;};
527 bool isEditable() const {return m_iseditable;};
529 void deleteAction() { /** TODO */ };
530 QString getXmlContextName() const {return "Sect4";};
532 private:
533 // Pointer to the associated Data
534 NodeList_type m_list;
535 bool m_iseditable;
540 Represents the DocBook \p Sec5 element of the document.\n
541 Structural item only (no references to a DOM node).
542 @author Robert Vogl
544 class Sect5 : public ListViewInterface
546 public:
547 Sect5(ListViewInterface *parent=0, ListViewInterface *after=0, QString label=QString());
548 ~Sect5();
550 void setNodes( const NodeList_type &list ){m_list = list;};
551 void getNodes( NodeList_type &list ) const {list = m_list;};
552 QString getRTFHeader() const;
553 QString getHeader() const;
554 QString getRTFData() const {return QString();};
555 QString getData() const {return QString();};
556 QString getRawData() const {return QString();};
557 void setData(const QString &, QDomDocument &) { /** structural element only */ };
558 void setEditable(bool editable) {m_iseditable = editable;};
559 bool isEditable() const {return m_iseditable;};
561 void deleteAction() { /** TODO */ };
562 QString getXmlContextName() const {return "Sect5";};
564 private:
565 // Pointer to the associated Data
566 NodeList_type m_list;
567 bool m_iseditable;
570 #endif