QCodeEdit  2.2
qlanguagefactory.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 _QLANGUAGE_FACTORY_H_
17 #define _QLANGUAGE_FACTORY_H_
18 
30 #include "qce-config.h"
31 
32 #include <QHash>
33 #include <QObject>
34 #include <QStringList>
35 
36 class QEditor;
37 class QFormatScheme;
40 
42 {
43  Q_OBJECT
44 
45  public:
46  struct LangData
47  {
48  QString lang, mime;
49  QStringList extensions;
50 
51  QFormatScheme *s;
52 
55  };
56 
58  virtual ~QLanguageFactory();
59 
60  QStringList languages() const;
61  QStringList fileFilters() const;
62 
63  const LangData& languageData(const QString& lang);
64 
65  void addDefinitionPath(const QString& path);
66 
67  inline QFormatScheme* defaultFormatScheme() const { return m_defaultFormatScheme; }
68 
69  public slots:
70  void addLanguage(const LangData& d);
71  void addLanguageDefinition(QLanguageDefinition *l);
72  void addCompletionEngine(QCodeCompletionEngine *e);
73 
74  virtual void setLanguage(QEditor *e, const QString& f);
75 
76  private:
77  QStringList m_languages;
78  QHash<QString, LangData> m_data;
79  QList<QCodeCompletionEngine*> m_unusedEngines;
80 
81  QFormatScheme *m_defaultFormatScheme;
82 };
83 
84 #endif // _QLANGUAGE_FACTORY_H_
#define QCE_EXPORT
Macro needed for cross-platform shared libraries creation.
Definition: qce-config.h:40
Utility file for shared library creation.
A text editing widget.
Definition: qeditor.h:55
A storage/configuration class for shared highlighting formats.
Definition: qformatscheme.h:41
Definition: qlanguagefactory.h:46
Definition: qcodecompletionengine.h:38
Interface for language definition.
Definition: qlanguagedefinition.h:40
A class managing language definitions.
Definition: qlanguagefactory.h:41