summaryrefslogtreecommitdiffstats
path: root/ksayit/src/docbookparser.h
blob: 66deb91f49ab90f1e1d337dcc85f41845315f288 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
//
// C++ Interface: docbookparser
//
// Description:
//
//
// Author: Robert Vogl <voglrobe@lapislazuli>, (C) 2005
//
// Copyright: See COPYING file that comes with this distribution
//
//
#ifndef DOCBOOKPARSER_H
#define DOCBOOKPARSER_H

// TQt includes
#include <tqdom.h>

// KDE includes

// App specific includes
#include "Types.h"
#include "contextmenuhandler.h"


class DocbookParser
{
public:
    // Constructor
    DocbookParser(ContextMenuHandler *cmHandler=0);

    // Destructor
    ~DocbookParser();
    
    void parseBook(const TQDomElement &element, ListViewInterface *item);
    
    int getIdCounter(){ return m_idCounter; };

private: // Methods
    // a selection of DocBook elements
    void parseBookInfo(const TQDomElement &element, ListViewInterface *item);
    void parseAuthorGroup(const TQDomElement &element, ListViewInterface *item);
    void parseAuthor(const TQDomElement &element, ListViewInterface *item);
    void parseKeywordSet(const TQDomElement &element, ListViewInterface *item);
    void parseAbstract(const TQDomElement &element, ListViewInterface *item);
    void parseChapter(const TQDomElement &element, ListViewInterface *item);
    void parseSect1(const TQDomElement &element, ListViewInterface *item);
    void parseSect2(const TQDomElement &element, ListViewInterface *item);
    void parseSect3(const TQDomElement &element, ListViewInterface *item);
    void parseSect4(const TQDomElement &element, ListViewInterface *item);
    void parseSect5(const TQDomElement &element, ListViewInterface *item);
    void parsePara(const TQDomElement &element, ListViewInterface *item);

    // Helpers
    TQString node2raw(TQDomNode node) const;
    
private: // Attributes
    ContextMenuHandler *m_contextmenuhandler;
    int m_idCounter;

};

#endif