QLanguageDefinition Class Reference
[Language framework]

Interface for language definition. More...

Inheritance diagram for QLanguageDefinition:

Inheritance graph
[legend]

List of all members.

Public Types

enum  CollapseFlag {
  None = 0x00000000, Collapsible = 0x10000000, Collapsed = 0x20000000, Closure = 0x40000000,
  CloseMask = 0x00fff000, OpenMask = 0x00000fff
}
 Collapse state of a line. More...

Public Member Functions

 Q_DECLARE_FLAGS (CollapseState, CollapseFlag)
virtual QString language () const =0
virtual QStringList extensions () const =0
 QLanguageDefinition ()
 Empty constructor.
virtual ~QLanguageDefinition ()
 Empty destructor.
virtual int tokenize (QDocument *d, int line, int count)
 Entry point for syntax highlighting.
virtual QString singleLineComment () const
 Return the string starting a single line comment, if any offered by the language.
virtual QString defaultLineMark () const
 Let language specify which line mark should be toggled by left clicking a line mark panel.
virtual void match (QDocumentCursor &c)
 Brace matching entry point.
virtual void clearMatches (QDocument *d)
 Brace matching entry point.
virtual QString indent (const QDocumentCursor &c)
 Return the indent to use when inserting a line at a given cursor position.
virtual bool unindent (const QDocumentCursor &c, const QString &ktxt)
 Determines whether the given key event at the given position should cause unindent to happen.
virtual void expand (QDocument *d, int line)
 Expand a collapsed block at a given line.
virtual void collapse (QDocument *d, int line)
 Collapse a text block at a given line.
virtual int blockFlags (QDocument *d, int line, int depth=0) const
 Compute the collapse state of a line.


Detailed Description

Interface for language definition.

This class is meant to be subclassed, see

See also:
QGenericDefinition for more informations, and added to a QLanguageFactory.
A language definition is a wrapper that creates interfaces for a given file extension from internally handled data (XML files in the case of QGenericDefinition)

See also:
QLanguageFactory

Member Enumeration Documentation

Collapse state of a line.

Enumerator:
None  The line cannot be collapsed nor expanded.
Collapsible  The line is expanded and can thus be collapsed.
Collapsed  The line is collapsed and can thus be expanded.
Closure  The line is expanded and mark the end of a block.
CloseMask  Number of actual closing fold mark.
OpenMask  Number of actual open fold mark.


The documentation for this class was generated from the following files:

Generated on Sun Feb 15 22:50:20 2009 for QCodeEdit by  doxygen 1.5.7.1