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
16 #include <QtXml/qdom.h>
19 #include <k3listview.h>
21 // App specific includes
24 // forward declarations
27 // Classes for Roberts elements
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).
35 class RobDocument
: public ListViewInterface
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());
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";};
68 // Classes for Docbook elements
71 Represents the DocBook \p Overview element of the document.\n
72 Structural item only (no references to a DOM node).
75 class Overview
: public ListViewInterface
78 Overview(ListViewInterface
*parent
=0, ListViewInterface
*after
=0, QString label
=QString());
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";};
102 Represents the DocBook \p Date element of the document.\n
105 class Date
: public ListViewInterface
108 Date(ListViewInterface
*parent
=0, ListViewInterface
*after
=0, QString label
=QString());
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";};
126 // Pointer to the associated Data
133 Represents the DocBook \p ReleasInfo element of the document.\n
136 class ReleaseInfo
: public ListViewInterface
139 ReleaseInfo(ListViewInterface
*parent
=0, ListViewInterface
*after
=0, QString label
=QString());
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";};
157 // Pointer to the associated Data
164 Represents the DocBook \p AuthorGroup element of the document.\n
165 Structural item only (no references to a DOM node).
168 class AuthorGroup
: public ListViewInterface
171 AuthorGroup(ListViewInterface
*parent
=0, ListViewInterface
*after
=0, QString label
=QString());
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";};
189 NodeList_type m_list
;
195 Represents the DocBook \p Author element and its Subelements
196 \p Firstname and \p Surname of the document.\n
199 class Author
: public ListViewInterface
202 Author(ListViewInterface
*parent
=0, ListViewInterface
*after
=0, QString label
=QString());
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
;};
238 // Pointer to the associated Data
246 Represents the DocBook \p KeywordSet element of the document.\n
247 Structural item only (no references to a DOM node).
250 class KeywordSet
: public ListViewInterface
253 KeywordSet(ListViewInterface
*parent
=0, ListViewInterface
*after
=0, QString label
=QString());
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";};
271 NodeList_type m_list
;
277 Represents the DocBook \p Keyword element of the document.\n
280 class Keyword
: public ListViewInterface
283 Keyword(ListViewInterface
*parent
=0, ListViewInterface
*after
=0, QString label
=QString());
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";};
301 // Pointer to the associated Data
308 Represents the DocBook \p Abstract element of the document.\n
309 Structural item only (no references to a DOM node).
312 class Abstract
: public ListViewInterface
315 Abstract(ListViewInterface
*parent
=0, ListViewInterface
*after
=0, QString label
=QString());
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";};
333 NodeList_type m_list
;
339 Represents a DocBook Paragraph item of the document.\n
342 class Para
: public ListViewInterface
345 Para(ListViewInterface
*parent
=0, ListViewInterface
*after
=0, QString label
=QString());
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
;};
371 // Pointer to the associated Data
378 Represents the DocBook \p Chapter element of the document.\n
379 Structural item only (no references to a DOM node).
382 class Chapter
: public ListViewInterface
385 Chapter(ListViewInterface
*parent
=0, ListViewInterface
*after
=0, QString label
=QString());
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";};
403 // Pointer to the associated Data
404 NodeList_type m_list
;
410 Represents the DocBook \p Sec1 element of the document.\n
411 Structural item only (no references to a DOM node).
414 class Sect1
: public ListViewInterface
417 Sect1(ListViewInterface
*parent
=0, ListViewInterface
*after
=0, QString label
=QString());
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";};
435 // Pointer to the associated Data
436 NodeList_type m_list
;
442 Represents the DocBook \p Sec2 element of the document.\n
443 Structural item only (no references to a DOM node).
446 class Sect2
: public ListViewInterface
449 Sect2(ListViewInterface
*parent
=0, ListViewInterface
*after
=0, QString label
=QString());
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";};
467 // Pointer to the associated Data
468 NodeList_type m_list
;
474 Represents the DocBook \p Sec3 element of the document.\n
475 Structural item only (no references to a DOM node).
478 class Sect3
: public ListViewInterface
481 Sect3(ListViewInterface
*parent
=0, ListViewInterface
*after
=0, QString label
=QString());
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";};
499 // Pointer to the associated Data
500 NodeList_type m_list
;
506 Represents the DocBook \p Sec4 element of the document.\n
507 Structural item only (no references to a DOM node).
510 class Sect4
: public ListViewInterface
513 Sect4(ListViewInterface
*parent
=0, ListViewInterface
*after
=0, QString label
=QString());
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";};
531 // Pointer to the associated Data
532 NodeList_type m_list
;
538 Represents the DocBook \p Sec5 element of the document.\n
539 Structural item only (no references to a DOM node).
542 class Sect5
: public ListViewInterface
545 Sect5(ListViewInterface
*parent
=0, ListViewInterface
*after
=0, QString label
=QString());
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";};
563 // Pointer to the associated Data
564 NodeList_type m_list
;