editors/qeditor/parenmatcher.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
#ifndef PARENMATCHER_H
00022
#define PARENMATCHER_H
00023
00024
#include <qstring.h>
00025
#include <qvaluelist.h>
00026
#include "dlldefs.h"
00027
00028
class QTextCursor;
00029
00030 struct EDITOR_EXPORT Paren
00031 {
00032 Paren() : type( Open ), chr( ' ' ), pos( -1 ) {}
00033 Paren(
int t,
const QChar &c,
int p ) : type( (Type)t ), chr( c ), pos( p ) {}
00034 enum Type { Open, Closed };
00035 Type type;
00036 QChar chr;
00037 int pos;
00038 };
00039
00040 typedef QValueList<Paren> ParenList;
00041
00042 class EDITOR_EXPORT ParenMatcher
00043 {
00044
public:
00045 enum Selection {
00046 Match = 1,
00047 Mismatch
00048 };
00049
00050 ParenMatcher();
00051
00052
virtual bool match( QTextCursor *c );
00053
00054 void setEnabled(
bool b ) { enabled = b; }
00055
00056
private:
00057
bool checkOpenParen( QTextCursor *c );
00058
bool checkClosedParen( QTextCursor *c );
00059
00060 bool enabled;
00061
00062 };
00063
00064
#endif
This file is part of the documentation for KDevelop Version 3.0.4.