paragdata.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
00022
00023
00024
00025 #ifndef paragdata_h
00026 #define paragdata_h
00027
00028 #include <private/qrichtext_p.h>
00029 #include <qvaluelist.h>
00030 #include <qmap.h>
00031 #include <qvariant.h>
00032
00033 class Symbol{
00034 public:
00035 enum Type { Left, Right };
00036 Symbol() {}
00037
00038 Symbol( int tp, const QChar& ch, int pos ):
00039 m_tp( tp ),
00040 m_ch( ch ),
00041 m_pos( pos )
00042 {}
00043
00044 Symbol( const Symbol& source )
00045 : m_tp( source.m_tp ),
00046 m_ch( source.m_ch ),
00047 m_pos( source.m_pos )
00048 {}
00049
00050 Symbol& operator = ( const Symbol& source ){
00051 m_tp = source.m_tp;
00052 m_ch = source.m_ch;
00053 m_pos = source.m_pos;
00054 return *this;
00055 }
00056
00057 bool operator == ( const Symbol& p ) const {
00058 return m_tp == p.m_tp && m_ch == p.m_ch && m_pos == p.m_pos;
00059 }
00060
00061 int type() const { return m_tp; }
00062 QChar ch() const { return m_ch; }
00063 int pos() const { return m_pos; }
00064
00065 private:
00066 int m_tp;
00067 QChar m_ch;
00068 int m_pos;
00069 };
00070
00071
00072 class ParagData: public QTextParagraphData{
00073 public:
00074 ParagData();
00075 virtual ~ParagData();
00076
00077 void clear();
00078 QValueList<Symbol> symbolList() const { return m_symbolList; }
00079
00080 void add( int, const QChar&, int );
00081 void join( QTextParagraphData* );
00082
00083 int level() const;
00084 void setLevel( int );
00085
00086 bool isOpen() const;
00087 void setOpen( bool );
00088
00089 bool isBlockStart() const;
00090 void setBlockStart( bool );
00091
00092 bool isParsed() const;
00093 void setParsed( bool );
00094
00095 uint mark() const;
00096 void setMark( uint );
00097
00098 int lastLengthForCompletion;
00099
00100 private:
00101 QValueList<Symbol> m_symbolList;
00102 int m_level;
00103 int m_mark;
00104 bool m_open;
00105 bool m_blockStart;
00106 bool m_parsed;
00107 };
00108
00109 #endif
This file is part of the documentation for KDevelop Version 3.1.2.