QCodeEdit  2.2
qformatscheme.h
Go to the documentation of this file.
1 /****************************************************************************
2 **
3 ** Copyright (C) 2006-2009 fullmetalcoder <fullmetalcoder@hotmail.fr>
4 **
5 ** This file is part of the Edyuk project <http://edyuk.org>
6 **
7 ** This file may be used under the terms of the GNU General Public License
8 ** version 3 as published by the Free Software Foundation and appearing in the
9 ** file GPL.txt included in the packaging of this file.
10 **
11 ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
12 ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
13 **
14 ****************************************************************************/
15 
16 #ifndef _QFORMAT_SCHEME_H_
17 #define _QFORMAT_SCHEME_H_
18 
30 #include "qce-config.h"
31 
32 #include <QVector>
33 #include <QObject>
34 
35 struct QFormat;
36 class QString;
37 class QSettings;
38 class QStringList;
39 class QDomElement;
40 
42 {
43  Q_OBJECT
44 
45  public:
46  QFormatScheme(QObject *p = 0);
47  QFormatScheme(const QString& f, QObject *p = 0);
48  virtual ~QFormatScheme();
49 
50  void clear();
51 
52  virtual void load(const QString& filename);
53  virtual void save(const QString& filename = QString()) const;
54 
55  virtual void load(const QDomElement& doc, bool ignoreNewIds = false);
56  virtual void save(QDomElement& elem) const;
57 
58  virtual void load(QSettings& s, bool ignoreNewIds = false);
59  virtual void save(QSettings& s) const;
60 
61  int formatCount() const;
62  QStringList formats() const;
63 
64  virtual QString id(int ifid) const;
65  virtual int id(const QString& sfid) const;
66 
67  virtual QFormat& formatRef(int ifid);
68  virtual QFormat& formatRef(const QString& sfid);
69 
70  virtual QFormat format(int ifid) const;
71  virtual QFormat format(const QString& sfid) const;
72 
73  public slots:
74  virtual void setFormat(const QString& fid, const QFormat& fmt);
75 
76  protected:
77  QString m_settings;
78 
79  QVector<QString> m_formatKeys;
80  QVector<QFormat> m_formatValues;
81 };
82 
83 #endif // !_QFORMAT_SCHEME_H_
#define QCE_EXPORT
Macro needed for cross-platform shared libraries creation.
Definition: qce-config.h:40
Utility file for shared library creation.
Definition: qformat.h:31
A storage/configuration class for shared highlighting formats.
Definition: qformatscheme.h:41