~ubuntu-branches/ubuntu/wily/tora/wily-proposed

« back to all changes in this revision

Viewing changes to src/qscintilla2/Qt4/Qsci/qscilexerfortran77.h

  • Committer: Bazaar Package Importer
  • Author(s): Michael Meskes
  • Date: 2009-11-19 15:18:19 UTC
  • mfrom: (1.2.9 upstream) (3.3.3 squeeze)
  • Revision ID: james.westby@ubuntu.com-20091119151819-me89ezmxzkvl0lws
Tags: 2.1.1-1
New upstream version.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// This defines the interface to the QsciLexerFortran77 class.
 
2
//
 
3
// Copyright (c) 2008 Riverbank Computing Limited <info@riverbankcomputing.com>
 
4
// 
 
5
// This file is part of QScintilla.
 
6
// 
 
7
// This file may be used under the terms of the GNU General Public
 
8
// License versions 2.0 or 3.0 as published by the Free Software
 
9
// Foundation and appearing in the files LICENSE.GPL2 and LICENSE.GPL3
 
10
// included in the packaging of this file.  Alternatively you may (at
 
11
// your option) use any later version of the GNU General Public
 
12
// License if such license has been publicly approved by Riverbank
 
13
// Computing Limited (or its successors, if any) and the KDE Free Qt
 
14
// Foundation. In addition, as a special exception, Riverbank gives you
 
15
// certain additional rights. These rights are described in the Riverbank
 
16
// GPL Exception version 1.1, which can be found in the file
 
17
// GPL_EXCEPTION.txt in this package.
 
18
// 
 
19
// Please review the following information to ensure GNU General
 
20
// Public Licensing requirements will be met:
 
21
// http://trolltech.com/products/qt/licenses/licensing/opensource/. If
 
22
// you are unsure which license is appropriate for your use, please
 
23
// review the following information:
 
24
// http://trolltech.com/products/qt/licenses/licensing/licensingoverview
 
25
// or contact the sales department at sales@riverbankcomputing.com.
 
26
// 
 
27
// This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
 
28
// INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
 
29
// A PARTICULAR PURPOSE. Trolltech reserves all rights not expressly
 
30
// granted herein.
 
31
// 
 
32
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
 
33
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
 
34
 
 
35
 
 
36
#ifndef QSCILEXERFORTRAN77_H
 
37
#define QSCILEXERFORTRAN77_H
 
38
 
 
39
#ifdef __APPLE__
 
40
extern "C++" {
 
41
#endif
 
42
 
 
43
#include <qobject.h>
 
44
 
 
45
#include <Qsci/qsciglobal.h>
 
46
#include <Qsci/qscilexer.h>
 
47
 
 
48
 
 
49
//! \brief The QsciLexerFortran77 class encapsulates the Scintilla Fortran77
 
50
//! lexer.
 
51
class QSCINTILLA_EXPORT QsciLexerFortran77 : public QsciLexer
 
52
{
 
53
    Q_OBJECT
 
54
 
 
55
public:
 
56
    //! This enum defines the meanings of the different styles used by the
 
57
    //! Fortran77 lexer.
 
58
    enum {
 
59
        //! The default.
 
60
        Default = 0,
 
61
 
 
62
        //! A comment.
 
63
        Comment = 1,
 
64
 
 
65
        //! A number.
 
66
        Number = 2,
 
67
 
 
68
        //! A single-quoted string.
 
69
        SingleQuotedString = 3,
 
70
 
 
71
        //! A double-quoted string.
 
72
        DoubleQuotedString = 4,
 
73
 
 
74
        //! The end of a line where a string is not closed.
 
75
        UnclosedString = 5,
 
76
 
 
77
        //! An operator.
 
78
        Operator = 6,
 
79
 
 
80
        //! An identifier
 
81
        Identifier = 7,
 
82
 
 
83
        //! A keyword.
 
84
        Keyword = 8,
 
85
 
 
86
        //! An intrinsic function.
 
87
        IntrinsicFunction = 9,
 
88
 
 
89
        //! An extended, non-standard or user defined function.
 
90
        ExtendedFunction = 10,
 
91
 
 
92
        //! A pre-processor block.
 
93
        PreProcessor = 11,
 
94
 
 
95
        //! An operator in .NAME. format.
 
96
        DottedOperator = 12,
 
97
 
 
98
        //! A label.
 
99
        Label = 13,
 
100
 
 
101
        //! A continuation.
 
102
        Continuation = 14
 
103
    };
 
104
 
 
105
    //! Construct a QsciLexerFortran77 with parent \a parent.  \a parent is
 
106
    //! typically the QsciScintilla instance.
 
107
    QsciLexerFortran77(QObject *parent = 0);
 
108
 
 
109
    //! Destroys the QsciLexerFortran77 instance.
 
110
    virtual ~QsciLexerFortran77();
 
111
 
 
112
    //! Returns the name of the language.
 
113
    const char *language() const;
 
114
 
 
115
    //! Returns the name of the lexer.  Some lexers support a number of
 
116
    //! languages.
 
117
    const char *lexer() const;
 
118
 
 
119
    //! \internal Returns the style used for braces for brace matching.
 
120
    int braceStyle() const;
 
121
 
 
122
    //! Returns the foreground colour of the text for style number \a style.
 
123
    //!
 
124
    //! \sa defaultPaper()
 
125
    QColor defaultColor(int style) const;
 
126
 
 
127
    //! Returns the end-of-line fill for style number \a style.
 
128
    bool defaultEolFill(int style) const;
 
129
 
 
130
    //! Returns the font for style number \a style.
 
131
    QFont defaultFont(int style) const;
 
132
 
 
133
    //! Returns the background colour of the text for style number \a style.
 
134
    //!
 
135
    //! \sa defaultColor()
 
136
    QColor defaultPaper(int style) const;
 
137
 
 
138
    //! Returns the set of keywords for the keyword set \a set recognised
 
139
    //! by the lexer as a space separated string.
 
140
    const char *keywords(int set) const;
 
141
 
 
142
    //! Returns the descriptive name for style number \a style.  If the
 
143
    //! style is invalid for this language then an empty QString is returned.
 
144
    //! This is intended to be used in user preference dialogs.
 
145
    QString description(int style) const;
 
146
 
 
147
    //! Causes all properties to be refreshed by emitting the
 
148
    //! propertyChanged() signal as required.
 
149
    void refreshProperties();
 
150
 
 
151
    //! Returns true if trailing blank lines are included in a fold block.
 
152
    //!
 
153
    //! \sa setFoldCompact()
 
154
    bool foldCompact() const;
 
155
 
 
156
public slots:
 
157
    //! If \a fold is true then trailing blank lines are included in a fold
 
158
    //! block. The default is true.
 
159
    //!
 
160
    //! \sa foldCompact()
 
161
    virtual void setFoldCompact(bool fold);
 
162
 
 
163
protected:
 
164
    //! The lexer's properties are read from the settings \a qs.  \a prefix
 
165
    //! (which has a trailing '/') should be used as a prefix to the key of
 
166
    //! each setting.  true is returned if there is no error.
 
167
    //!
 
168
    //! \sa writeProperties()
 
169
    bool readProperties(QSettings &qs,const QString &prefix);
 
170
 
 
171
    //! The lexer's properties are written to the settings \a qs.
 
172
    //! \a prefix (which has a trailing '/') should be used as a prefix to
 
173
    //! the key of each setting.  true is returned if there is no error.
 
174
    //!
 
175
    //! \sa readProperties()
 
176
    bool writeProperties(QSettings &qs,const QString &prefix) const;
 
177
 
 
178
private:
 
179
    void setCompactProp();
 
180
 
 
181
    bool fold_compact;
 
182
 
 
183
    QsciLexerFortran77(const QsciLexerFortran77 &);
 
184
    QsciLexerFortran77 &operator=(const QsciLexerFortran77 &);
 
185
};
 
186
 
 
187
#ifdef __APPLE__
 
188
}
 
189
#endif
 
190
 
 
191
#endif