1 /***************************************************************************
2  *   Copyright (C) 2015 by Jens Nissen jens-chessx@gmx.net                 *
3  *   Copyright (C) 2006 by Tobias Koenig <tokoe@kde.org>                   *
4  *                                                                         *
5  *   This program is free software; you can redistribute it and/or modify  *
6  *   it under the terms of the GNU General Public License as published by  *
7  *   the Free Software Foundation; either version 2 of the License, or     *
8  *   (at your option) any later version.                                   *
9  ***************************************************************************/
10 
11 #ifndef OOO_STYLEPARSER_H
12 #define OOO_STYLEPARSER_H
13 
14 #include "formatproperty.h"
15 
16 #include <QDomDocument>
17 
18 class QDomElement;
19 
20 namespace OOO {
21 
22 class Document;
23 class StyleInformation;
24 
25 class StyleParser
26 {
27   public:
28     StyleParser( const Document *document, const QDomDocument &domDocument, StyleInformation *styleInformation );
29 
30     bool parse();
31 
32     static double convertUnit( const QString& );
33 
34   private:
35     bool parseContentFile();
36     bool parseStyleFile();
37     bool parseMetaFile();
38 
39     bool parseDocumentCommonAttrs( QDomElement& );
40     bool parseFontFaceDecls( QDomElement& );
41     bool parseStyles( QDomElement& );
42     bool parseMasterStyles( QDomElement& );
43     bool parseAutomaticStyles( QDomElement& );
44 
45     StyleFormatProperty parseStyleProperty( QDomElement& );
46     ParagraphFormatProperty parseParagraphProperty( QDomElement& );
47     TableColumnFormatProperty parseTableColumnProperty( QDomElement& );
48     TableCellFormatProperty parseTableCellProperty( QDomElement& );
49     TextFormatProperty parseTextProperty( QDomElement& );
50     PageFormatProperty parsePageProperty( QDomElement& );
51     ListFormatProperty parseListProperty( QDomElement& );
52 
53     const Document *m_pDocument;
54     const QDomDocument &m_DomDocument;
55     StyleInformation *m_StyleInformation;
56     bool m_MasterPageNameSet;
57 };
58 
59 }
60 
61 #endif
62