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_STYLEINFORMATION_H
12 #define OOO_STYLEINFORMATION_H
13 
14 #include "formatproperty.h"
15 #include <QMap>
16 
17 namespace OOO {
18 
19 class MetaInformation
20 {
21   public:
22     typedef QList<MetaInformation> List;
23 
24     MetaInformation( const QString &key, const QString &value, const QString &title );
25 
26     QString key() const;
27     QString value() const;
28     QString title() const;
29 
30   private:
31     QString mKey;
32     QString mValue;
33     QString mTitle;
34 };
35 
36 class StyleInformation
37 {
38   public:
39     StyleInformation();
40     ~StyleInformation();
41 
42     void addFontProperty( const QString &name, const FontFormatProperty &property );
43     FontFormatProperty fontProperty( const QString &name ) const;
44 
45     void addStyleProperty( const QString &name, const StyleFormatProperty &property );
46     StyleFormatProperty styleProperty( const QString &name ) const;
47 
48     void addPageProperty( const QString &name, const PageFormatProperty &property );
49     PageFormatProperty pageProperty( const QString &name ) const;
50     bool pagePropertyExists( const QString &name ) const;
51 
52     void addListProperty( const QString &name, const ListFormatProperty &property );
53     ListFormatProperty listProperty( const QString &name ) const;
54 
55     void addMasterLayout( const QString &name, const QString &layoutName );
56     QString masterLayout( const QString &name );
57     void setMasterPageName( const QString &name );
58     QString masterPageName() const;
59 
60     void addMetaInformation( const QString &key, const QString &value, const QString &title );
61     MetaInformation::List metaInformation() const;
62 
63     void dump() const;
64 
65   private:
66     QMap<QString, FontFormatProperty> m_FontProperties;
67     QMap<QString, StyleFormatProperty> m_StyleProperties;
68     QMap<QString, PageFormatProperty> m_PageProperties;
69     QMap<QString, ListFormatProperty> m_ListProperties;
70     QMap<QString, QString> m_MasterLayouts;
71     MetaInformation::List m_MetaInformation;
72     QString m_MasterPageName;
73 };
74 
75 }
76 
77 #endif
78