2 // C++ Interface: docbookclasses.h
7 // Author: Robert Vogl <voglrobe@lapislazuli>, (C) 2004
9 // Copyright: See COPYING file that comes with this distribution
12 #ifndef DOCBOOKCLASSES_H
13 #define DOCBOOKCLASSES_H
20 #include <k3listview.h>
22 // App specific includes
25 // forward declarations
29 // Classes for Roberts elements
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).
37 class RobDocument
: public ListViewInterface
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());
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";};
70 // Classes for Docbook elements
73 Represents the DocBook \p Overview element of the document.\n
74 Structural item only (no references to a DOM node).
77 class Overview
: public ListViewInterface
80 Overview(ListViewInterface
*parent
=0, ListViewInterface
*after
=0, QString label
=QString());
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";};
104 Represents the DocBook \p Date element of the document.\n
107 class Date
: public ListViewInterface
110 Date(ListViewInterface
*parent
=0, ListViewInterface
*after
=0, QString label
=QString());
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";};
128 // Pointer to the associated Data
135 Represents the DocBook \p ReleasInfo element of the document.\n
138 class ReleaseInfo
: public ListViewInterface
141 ReleaseInfo(ListViewInterface
*parent
=0, ListViewInterface
*after
=0, QString label
=QString());
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";};
159 // Pointer to the associated Data
166 Represents the DocBook \p AuthorGroup element of the document.\n
167 Structural item only (no references to a DOM node).
170 class AuthorGroup
: public ListViewInterface
173 AuthorGroup(ListViewInterface
*parent
=0, ListViewInterface
*after
=0, QString label
=QString());
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";};
191 NodeList_type m_list
;
197 Represents the DocBook \p Author element and its Subelements
198 \p Firstname and \p Surname of the document.\n
201 class Author
: public ListViewInterface
204 Author(ListViewInterface
*parent
=0, ListViewInterface
*after
=0, QString label
=QString());
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
;};
240 // Pointer to the associated Data
248 Represents the DocBook \p KeywordSet element of the document.\n
249 Structural item only (no references to a DOM node).
252 class KeywordSet
: public ListViewInterface
255 KeywordSet(ListViewInterface
*parent
=0, ListViewInterface
*after
=0, QString label
=QString());
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";};
273 NodeList_type m_list
;
279 Represents the DocBook \p Keyword element of the document.\n
282 class Keyword
: public ListViewInterface
285 Keyword(ListViewInterface
*parent
=0, ListViewInterface
*after
=0, QString label
=QString());
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";};
303 // Pointer to the associated Data
310 Represents the DocBook \p Abstract element of the document.\n
311 Structural item only (no references to a DOM node).
314 class Abstract
: public ListViewInterface
317 Abstract(ListViewInterface
*parent
=0, ListViewInterface
*after
=0, QString label
=QString());
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";};
335 NodeList_type m_list
;
341 Represents a DocBook Paragraph item of the document.\n
344 class Para
: public ListViewInterface
347 Para(ListViewInterface
*parent
=0, ListViewInterface
*after
=0, QString label
=QString());
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
;};
373 // Pointer to the associated Data
380 Represents the DocBook \p Chapter element of the document.\n
381 Structural item only (no references to a DOM node).
384 class Chapter
: public ListViewInterface
387 Chapter(ListViewInterface
*parent
=0, ListViewInterface
*after
=0, QString label
=QString());
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";};
405 // Pointer to the associated Data
406 NodeList_type m_list
;
412 Represents the DocBook \p Sec1 element of the document.\n
413 Structural item only (no references to a DOM node).
416 class Sect1
: public ListViewInterface
419 Sect1(ListViewInterface
*parent
=0, ListViewInterface
*after
=0, QString label
=QString());
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";};
437 // Pointer to the associated Data
438 NodeList_type m_list
;
444 Represents the DocBook \p Sec2 element of the document.\n
445 Structural item only (no references to a DOM node).
448 class Sect2
: public ListViewInterface
451 Sect2(ListViewInterface
*parent
=0, ListViewInterface
*after
=0, QString label
=QString());
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";};
469 // Pointer to the associated Data
470 NodeList_type m_list
;
476 Represents the DocBook \p Sec3 element of the document.\n
477 Structural item only (no references to a DOM node).
480 class Sect3
: public ListViewInterface
483 Sect3(ListViewInterface
*parent
=0, ListViewInterface
*after
=0, QString label
=QString());
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";};
501 // Pointer to the associated Data
502 NodeList_type m_list
;
508 Represents the DocBook \p Sec4 element of the document.\n
509 Structural item only (no references to a DOM node).
512 class Sect4
: public ListViewInterface
515 Sect4(ListViewInterface
*parent
=0, ListViewInterface
*after
=0, QString label
=QString());
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";};
533 // Pointer to the associated Data
534 NodeList_type m_list
;
540 Represents the DocBook \p Sec5 element of the document.\n
541 Structural item only (no references to a DOM node).
544 class Sect5
: public ListViewInterface
547 Sect5(ListViewInterface
*parent
=0, ListViewInterface
*after
=0, QString label
=QString());
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";};
565 // Pointer to the associated Data
566 NodeList_type m_list
;