1 /**************************************************************************
3 ** This file is part of Qt Creator
5 ** Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies).
7 ** Contact: Nokia Corporation (info@qt.nokia.com)
10 ** GNU Lesser General Public License Usage
12 ** This file may be used under the terms of the GNU Lesser General Public
13 ** License version 2.1 as published by the Free Software Foundation and
14 ** appearing in the file LICENSE.LGPL included in the packaging of this file.
15 ** Please review the following information to ensure the GNU Lesser General
16 ** Public License version 2.1 requirements will be met:
17 ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
19 ** In addition, as a special exception, Nokia gives you certain additional
20 ** rights. These rights are described in the Nokia Qt LGPL Exception
21 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
25 ** Alternatively, this file may be used in accordance with the terms and
26 ** conditions contained in a signed written agreement between you and Nokia.
28 ** If you have questions regarding the use of this file, please contact
29 ** Nokia at qt-info@nokia.com.
31 **************************************************************************/
36 #include "includerulesinstruction.h"
38 #include <QtCore/QString>
39 #include <QtCore/QList>
40 #include <QtCore/QSharedPointer>
42 namespace TextEditor {
46 class HighlightDefinition;
52 Context(const Context &context);
53 const Context &operator=(Context copy);
56 void configureId(const int unique);
57 const QString &id() const;
59 void setName(const QString &name);
60 const QString &name() const;
62 void setLineBeginContext(const QString &context);
63 const QString &lineBeginContext() const;
65 void setLineEndContext(const QString &context);
66 const QString &lineEndContext() const;
68 void setFallthroughContext(const QString &context);
69 const QString &fallthroughContext() const;
71 void setItemData(const QString &itemData);
72 const QString &itemData() const;
74 void setFallthrough(const QString &fallthrough);
75 bool isFallthrough() const;
77 void setDynamic(const QString &dynamic);
78 bool isDynamic() const;
79 void updateDynamicRules(const QStringList &captures) const;
81 void addRule(const QSharedPointer<Rule> &rule);
82 void addRule(const QSharedPointer<Rule> &rule, int index);
83 const QList<QSharedPointer<Rule> > &rules() const;
85 void addIncludeRulesInstruction(const IncludeRulesInstruction &instruction);
86 const QList<IncludeRulesInstruction> &includeRulesInstructions() const;
87 void clearIncludeRulesInstructions();
89 void setDefinition(const QSharedPointer<HighlightDefinition> &definition);
90 const QSharedPointer<HighlightDefinition> &definition() const;
92 void swap(Context &context);
97 QString m_lineBeginContext;
98 QString m_lineEndContext;
99 QString m_fallthroughContext;
104 QList<QSharedPointer<Rule> > m_rules;
105 QList<IncludeRulesInstruction> m_instructions;
107 QSharedPointer<HighlightDefinition> m_definition;
110 } // namespace Internal
111 } // namespace TextEditor