KDevelop API Documentation

paragdata.h

Go to the documentation of this file.
00001 // (C) 2001-2002 Trolltech AS
00002 
00003 /* $Id: paragdata.h,v 1.10 2002/12/19 22:02:39 raggi Exp $
00004  *
00005  *  This file is part of Klint
00006  *  Copyright (C) 2001 Roberto Raggi (roberto@kdevelop.org)
00007  *
00008  *  This program is free software; you can redistribute it and/or
00009  *  modify it under the terms of the GNU General Public
00010  *  License as published by the Free Software Foundation; either
00011  *  version 2 of the License, or (at your option) any later version.
00012  *
00013  *  This program is distributed in the hope that it will be useful,
00014  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00015  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00016  *  General Public License for more details.
00017  *
00018  *  You should have received a copy of the GNU General Public License
00019  *  along with this program; see the file COPYING.  If not, write to
00020  *  the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
00021  *  Boston, MA 02111-1307, USA.
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
KDE Logo
This file is part of the documentation for KDevelop Version 3.1.2.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Wed Mar 23 00:03:42 2005 by doxygen 1.3.9.1 written by Dimitri van Heesch, © 1997-2003