QCodeEdit
2.2
Main Page
Related Pages
Modules
Classes
Files
File List
File Members
lib
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
;
38
class
QLanguageDefinition
;
39
class
QCodeCompletionEngine
;
40
41
class
QCE_EXPORT
QLanguageFactory
:
public
QObject
42
{
43
Q_OBJECT
44
45
public
:
46
struct
LangData
47
{
48
QString lang, mime;
49
QStringList extensions;
50
51
QFormatScheme
*s;
52
53
QLanguageDefinition
*d;
54
QCodeCompletionEngine
*e;
55
};
56
57
QLanguageFactory
(
QFormatScheme
*fmt,
QObject
*p = 0);
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_
Generated by
1.8.1.1