Sophie

Sophie

distrib > Mandriva > 2010.0 > i586 > media > contrib-release > by-pkgid > a6711891ce757817bba854bf3f25205a > files > 873

qtjambi-doc-4.3.3-3mdv2008.1.i586.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc (build 1.5.0_09) on Tue Aug 07 17:04:32 CEST 2007 -->
<TITLE>
QSyntaxHighlighter
</TITLE>

<META NAME="keywords" CONTENT="com.trolltech.qt.gui.QSyntaxHighlighter class">

<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../stylesheet.css" TITLE="Style">

<SCRIPT type="text/javascript">
function windowTitle()
{
    parent.document.title="QSyntaxHighlighter";
}
</SCRIPT>
<NOSCRIPT>
</NOSCRIPT>

</HEAD>

<BODY BGCOLOR="white" onload="windowTitle();">


<!-- ========= START OF TOP NAVBAR ======= -->
<A NAME="navbar_top"><!-- --></A>
<A HREF="#skip-navbar_top" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_top_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
  <TR ALIGN="center" VALIGN="top">
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
  </TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>

<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;<A HREF="../../../../com/trolltech/qt/gui/QStylePainter.html" title="class in com.trolltech.qt.gui"><B>PREV CLASS</B></A>&nbsp;
&nbsp;<A HREF="../../../../com/trolltech/qt/gui/QSystemTrayIcon.html" title="class in com.trolltech.qt.gui"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
  <A HREF="../../../../index.html?com/trolltech/qt/gui/QSyntaxHighlighter.html" target="_top"><B>FRAMES</B></A>  &nbsp;
&nbsp;<A HREF="QSyntaxHighlighter.html" target="_top"><B>NO FRAMES</B></A>  &nbsp;
&nbsp;<SCRIPT type="text/javascript">
  <!--
  if(window==top) {
    document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>');
  }
  //-->
</SCRIPT>
<NOSCRIPT>
  <A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>


</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
  SUMMARY:&nbsp;<A HREF="#nested_classes_inherited_from_class_com.trolltech.qt.QSignalEmitter">NESTED</A>&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL:&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_top"></A>
<!-- ========= END OF TOP NAVBAR ========= -->

<HR>
<!-- ======== START OF CLASS DATA ======== -->
<H2>
<FONT SIZE="-1">
com.trolltech.qt.gui</FONT>
<BR>
Class QSyntaxHighlighter</H2>
<PRE>
java.lang.Object
  <IMG SRC="../../../../resources/inherit.gif" ALT="extended by "><A HREF="../../../../com/trolltech/qt/QSignalEmitter.html" title="class in com.trolltech.qt">com.trolltech.qt.QSignalEmitter</A>
      <IMG SRC="../../../../resources/inherit.gif" ALT="extended by "><A HREF="../../../../com/trolltech/qt/QtJambiObject.html" title="class in com.trolltech.qt">com.trolltech.qt.QtJambiObject</A>
          <IMG SRC="../../../../resources/inherit.gif" ALT="extended by "><A HREF="../../../../com/trolltech/qt/core/QObject.html" title="class in com.trolltech.qt.core">com.trolltech.qt.core.QObject</A>
              <IMG SRC="../../../../resources/inherit.gif" ALT="extended by "><B>com.trolltech.qt.gui.QSyntaxHighlighter</B>
</PRE>
<DL>
<DT><B>All Implemented Interfaces:</B> <DD><A HREF="../../../../com/trolltech/qt/QtJambiInterface.html" title="interface in com.trolltech.qt">QtJambiInterface</A></DD>
</DL>
<HR>
<DL>
<DT><PRE>public abstract class <B>QSyntaxHighlighter</B><DT>extends <A HREF="../../../../com/trolltech/qt/core/QObject.html" title="class in com.trolltech.qt.core">QObject</A></DL>
</PRE>

<P>
<p>The <a href="QSyntaxHighlighter.html#QSyntaxHighlighter(com.trolltech.qt.gui.QTextEdit)"><tt>QSyntaxHighlighter</tt></a> class allows you to define syntax highlighting rules, and in addition you can use the class to query a document's current formatting or user data.</p>
<p>The <a href="QSyntaxHighlighter.html#QSyntaxHighlighter(com.trolltech.qt.gui.QTextEdit)"><tt>QSyntaxHighlighter</tt></a> class is a base class for implementing <a href="QTextEdit.html"><tt>QTextEdit</tt></a> syntax highlighters. A syntax highligher automatically highlights parts of the text in a <a href="QTextEdit.html"><tt>QTextEdit</tt></a>, or more generally in a <a href="QTextDocument.html"><tt>QTextDocument</tt></a>. Syntax highlighters are often used when the user is entering text in a specific format (for example source code) and help the user to read the text and identify syntax errors.</p>
<p>To provide your own syntax highlighting, you must subclass <a href="QSyntaxHighlighter.html#QSyntaxHighlighter(com.trolltech.qt.gui.QTextEdit)"><tt>QSyntaxHighlighter</tt></a> and reimplement <a href="QSyntaxHighlighter.html#highlightBlock(java.lang.String)"><tt>highlightBlock</tt></a>.</p>
<p>When you create an instance of your <a href="QSyntaxHighlighter.html#QSyntaxHighlighter(com.trolltech.qt.gui.QTextEdit)"><tt>QSyntaxHighlighter</tt></a> subclass, pass it the <a href="QTextEdit.html"><tt>QTextEdit</tt></a> or <a href="QTextDocument.html"><tt>QTextDocument</tt></a> that you want the syntax highlighting to be applied to. For example:</p>
<pre>    QTextEdit *editor = new QTextEdit;
    MyHighlighter *highlighter = new MyHighlighter(editor-&gt;document());</pre>
<p>After this your <a href="QSyntaxHighlighter.html#highlightBlock(java.lang.String)"><tt>highlightBlock</tt></a> function will be called automatically whenever necessary. Use your <a href="QSyntaxHighlighter.html#highlightBlock(java.lang.String)"><tt>highlightBlock</tt></a> function to apply formatting (e.g&#x2e; setting the font and color) to the text that is passed to it. <a href="QSyntaxHighlighter.html#QSyntaxHighlighter(com.trolltech.qt.gui.QTextEdit)"><tt>QSyntaxHighlighter</tt></a> provides the <a href="QSyntaxHighlighter.html#setFormat(int, int, com.trolltech.qt.gui.QTextCharFormat)"><tt>setFormat</tt></a> function which applies a given <a href="QTextCharFormat.html"><tt>QTextCharFormat</tt></a> on the current text block. For example:</p>
<pre>    void MyHighlighter::highlightBlock(const QString &amp;text)
    {
        QTextCharFormat myClassFormat;
        myClassFormat.setFontWeight(QFont::Bold);
        myClassFormat.setForeground(Qt::darkMagenta);
        QString pattern = &quot;\\bMy[A-Za-z]+\\b&quot;;

        QRegExp expression(pattern);
        int index = text.indexOf(expression);
        while (index &gt;= 0) {
            int length = expression.matchedLength();
            setFormat(index, length, myClassFormat);
            index = text.indexOf(expression, index + length);
         }
     }</pre>
<p>Some syntaxes can have constructs that span several text blocks. For example, a C++ syntax highlighter should be able to cope with <tt>/</tt><tt>*...*</tt><tt>/</tt> multiline comments. To deal with these cases it is necessary to know the end state of the previous text block (e.g&#x2e; &quot;in comment&quot;).</p>
<p>Inside your <a href="QSyntaxHighlighter.html#highlightBlock(java.lang.String)"><tt>highlightBlock</tt></a> implementation you can query the end state of the previous text block using the <a href="QSyntaxHighlighter.html#previousBlockState()"><tt>previousBlockState</tt></a> function. After parsing the block you can save the last state using <a href="QSyntaxHighlighter.html#setCurrentBlockState(int)"><tt>setCurrentBlockState</tt></a>.</p>
<p>The <a href="QSyntaxHighlighter.html#currentBlockState()"><tt>currentBlockState</tt></a> and <a href="QSyntaxHighlighter.html#previousBlockState()"><tt>previousBlockState</tt></a> functions return an int value. If no state is set, the returned value is -1. You can designate any other value to identify any given state using the <a href="QSyntaxHighlighter.html#setCurrentBlockState(int)"><tt>setCurrentBlockState</tt></a> function. Once the state is set the <a href="QTextBlock.html"><tt>QTextBlock</tt></a> keeps that value until it is set set again or until the corresponding paragraph of text is deleted.</p>
<p>For example, if you're writing a simple C++ syntax highlighter, you might designate 1 to signify &quot;in comment&quot;:</p>
<pre>    QTextCharFormat multiLineCommentFormat;
    multiLineCommentFormat.setForeground(Qt::red);

    QRegExp startExpression(&quot;/\\*&quot;);
    QRegExp endExpression(&quot;\\* /&quot;);

    setCurrentBlockState(0);

    int startIndex = 0;
    if (previousBlockState() != 1)
        startIndex = text.indexOf(startExpression);

    while (startIndex &gt;= 0) {
       int endIndex = text.indexOf(endExpression, startIndex);
       int commentLength;
       if (endIndex == -1) {
           setCurrentBlockState(1);
           commentLength = text.length() - startIndex;
       } else {
           commentLength = endIndex - startIndex
                           + endExpression.matchedLength();
       }
       setFormat(startIndex, commentLength, multiLineCommentFormat);
       startIndex = text.indexOf(startExpression,
                                 startIndex + commentLength);
    }</pre>
<p>In the example above, we first set the current block state to 0. Then, if the previous block ended within a comment, we higlight from the beginning of the current block (<tt>startIndex = 0</tt>). Otherwise, we search for the given start expression. If the specified end expression cannot be found in the text block, we change the current block state by calling <a href="QSyntaxHighlighter.html#setCurrentBlockState(int)"><tt>setCurrentBlockState</tt></a>, and make sure that the rest of the block is higlighted.</p>
<p>In addition you can query the current formatting and user data using the <a href="QSyntaxHighlighter.html#format(int)"><tt>format</tt></a> and <a href="QSyntaxHighlighter.html#currentBlockUserData()"><tt>currentBlockUserData</tt></a> functions respectively. You can also attach user data to the current text block using the <a href="QSyntaxHighlighter.html#setCurrentBlockUserData(com.trolltech.qt.gui.QTextBlockUserData)"><tt>setCurrentBlockUserData</tt></a> function. <a href="QTextBlockUserData.html"><tt>QTextBlockUserData</tt></a> can be used to store custom settings. In the case of syntax highlighting, it is in particular interesting as cache storage for information that you may figure out while parsing the paragraph's text. For an example, see the <a href="QSyntaxHighlighter.html#setCurrentBlockUserData(com.trolltech.qt.gui.QTextBlockUserData)"><tt>setCurrentBlockUserData</tt></a> documentation.</p>
<P>

<P>
<DL>
<DT><B>See Also:</B><DD><a href="QTextEdit.html"><tt>QTextEdit</tt></a>, 
<a href="%2E%2E/qtjambi-syntaxhighlighter.html">Syntax Highlighter Example</tt></a></DL>
<HR>

<P>
<!-- ======== NESTED CLASS SUMMARY ======== -->

<A NAME="nested_class_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Nested Class Summary</B></FONT></TH>
</TR>
</TABLE>
&nbsp;<A NAME="nested_classes_inherited_from_class_com.trolltech.qt.QSignalEmitter"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TH ALIGN="left"><B>Nested classes/interfaces inherited from class com.trolltech.qt.<A HREF="../../../../com/trolltech/qt/QSignalEmitter.html" title="class in com.trolltech.qt">QSignalEmitter</A></B></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><A HREF="../../../../com/trolltech/qt/QSignalEmitter.Signal0.html" title="class in com.trolltech.qt">QSignalEmitter.Signal0</A>, <A HREF="../../../../com/trolltech/qt/QSignalEmitter.Signal1.html" title="class in com.trolltech.qt">QSignalEmitter.Signal1</A>&lt;<A HREF="../../../../com/trolltech/qt/QSignalEmitter.Signal1.html" title="type parameter in QSignalEmitter.Signal1">A</A>&gt;, <A HREF="../../../../com/trolltech/qt/QSignalEmitter.Signal2.html" title="class in com.trolltech.qt">QSignalEmitter.Signal2</A>&lt;<A HREF="../../../../com/trolltech/qt/QSignalEmitter.Signal2.html" title="type parameter in QSignalEmitter.Signal2">A</A>,<A HREF="../../../../com/trolltech/qt/QSignalEmitter.Signal2.html" title="type parameter in QSignalEmitter.Signal2">B</A>&gt;, <A HREF="../../../../com/trolltech/qt/QSignalEmitter.Signal3.html" title="class in com.trolltech.qt">QSignalEmitter.Signal3</A>&lt;<A HREF="../../../../com/trolltech/qt/QSignalEmitter.Signal3.html" title="type parameter in QSignalEmitter.Signal3">A</A>,<A HREF="../../../../com/trolltech/qt/QSignalEmitter.Signal3.html" title="type parameter in QSignalEmitter.Signal3">B</A>,<A HREF="../../../../com/trolltech/qt/QSignalEmitter.Signal3.html" title="type parameter in QSignalEmitter.Signal3">C</A>&gt;, <A HREF="../../../../com/trolltech/qt/QSignalEmitter.Signal4.html" title="class in com.trolltech.qt">QSignalEmitter.Signal4</A>&lt;<A HREF="../../../../com/trolltech/qt/QSignalEmitter.Signal4.html" title="type parameter in QSignalEmitter.Signal4">A</A>,<A HREF="../../../../com/trolltech/qt/QSignalEmitter.Signal4.html" title="type parameter in QSignalEmitter.Signal4">B</A>,<A HREF="../../../../com/trolltech/qt/QSignalEmitter.Signal4.html" title="type parameter in QSignalEmitter.Signal4">C</A>,<A HREF="../../../../com/trolltech/qt/QSignalEmitter.Signal4.html" title="type parameter in QSignalEmitter.Signal4">D</A>&gt;, <A HREF="../../../../com/trolltech/qt/QSignalEmitter.Signal5.html" title="class in com.trolltech.qt">QSignalEmitter.Signal5</A>&lt;<A HREF="../../../../com/trolltech/qt/QSignalEmitter.Signal5.html" title="type parameter in QSignalEmitter.Signal5">A</A>,<A HREF="../../../../com/trolltech/qt/QSignalEmitter.Signal5.html" title="type parameter in QSignalEmitter.Signal5">B</A>,<A HREF="../../../../com/trolltech/qt/QSignalEmitter.Signal5.html" title="type parameter in QSignalEmitter.Signal5">C</A>,<A HREF="../../../../com/trolltech/qt/QSignalEmitter.Signal5.html" title="type parameter in QSignalEmitter.Signal5">D</A>,<A HREF="../../../../com/trolltech/qt/QSignalEmitter.Signal5.html" title="type parameter in QSignalEmitter.Signal5">E</A>&gt;, <A HREF="../../../../com/trolltech/qt/QSignalEmitter.Signal6.html" title="class in com.trolltech.qt">QSignalEmitter.Signal6</A>&lt;<A HREF="../../../../com/trolltech/qt/QSignalEmitter.Signal6.html" title="type parameter in QSignalEmitter.Signal6">A</A>,<A HREF="../../../../com/trolltech/qt/QSignalEmitter.Signal6.html" title="type parameter in QSignalEmitter.Signal6">B</A>,<A HREF="../../../../com/trolltech/qt/QSignalEmitter.Signal6.html" title="type parameter in QSignalEmitter.Signal6">C</A>,<A HREF="../../../../com/trolltech/qt/QSignalEmitter.Signal6.html" title="type parameter in QSignalEmitter.Signal6">D</A>,<A HREF="../../../../com/trolltech/qt/QSignalEmitter.Signal6.html" title="type parameter in QSignalEmitter.Signal6">E</A>,<A HREF="../../../../com/trolltech/qt/QSignalEmitter.Signal6.html" title="type parameter in QSignalEmitter.Signal6">F</A>&gt;, <A HREF="../../../../com/trolltech/qt/QSignalEmitter.Signal7.html" title="class in com.trolltech.qt">QSignalEmitter.Signal7</A>&lt;<A HREF="../../../../com/trolltech/qt/QSignalEmitter.Signal7.html" title="type parameter in QSignalEmitter.Signal7">A</A>,<A HREF="../../../../com/trolltech/qt/QSignalEmitter.Signal7.html" title="type parameter in QSignalEmitter.Signal7">B</A>,<A HREF="../../../../com/trolltech/qt/QSignalEmitter.Signal7.html" title="type parameter in QSignalEmitter.Signal7">C</A>,<A HREF="../../../../com/trolltech/qt/QSignalEmitter.Signal7.html" title="type parameter in QSignalEmitter.Signal7">D</A>,<A HREF="../../../../com/trolltech/qt/QSignalEmitter.Signal7.html" title="type parameter in QSignalEmitter.Signal7">E</A>,<A HREF="../../../../com/trolltech/qt/QSignalEmitter.Signal7.html" title="type parameter in QSignalEmitter.Signal7">F</A>,<A HREF="../../../../com/trolltech/qt/QSignalEmitter.Signal7.html" title="type parameter in QSignalEmitter.Signal7">G</A>&gt;, <A HREF="../../../../com/trolltech/qt/QSignalEmitter.Signal8.html" title="class in com.trolltech.qt">QSignalEmitter.Signal8</A>&lt;<A HREF="../../../../com/trolltech/qt/QSignalEmitter.Signal8.html" title="type parameter in QSignalEmitter.Signal8">A</A>,<A HREF="../../../../com/trolltech/qt/QSignalEmitter.Signal8.html" title="type parameter in QSignalEmitter.Signal8">B</A>,<A HREF="../../../../com/trolltech/qt/QSignalEmitter.Signal8.html" title="type parameter in QSignalEmitter.Signal8">C</A>,<A HREF="../../../../com/trolltech/qt/QSignalEmitter.Signal8.html" title="type parameter in QSignalEmitter.Signal8">D</A>,<A HREF="../../../../com/trolltech/qt/QSignalEmitter.Signal8.html" title="type parameter in QSignalEmitter.Signal8">E</A>,<A HREF="../../../../com/trolltech/qt/QSignalEmitter.Signal8.html" title="type parameter in QSignalEmitter.Signal8">F</A>,<A HREF="../../../../com/trolltech/qt/QSignalEmitter.Signal8.html" title="type parameter in QSignalEmitter.Signal8">G</A>,<A HREF="../../../../com/trolltech/qt/QSignalEmitter.Signal8.html" title="type parameter in QSignalEmitter.Signal8">H</A>&gt;, <A HREF="../../../../com/trolltech/qt/QSignalEmitter.Signal9.html" title="class in com.trolltech.qt">QSignalEmitter.Signal9</A>&lt;<A HREF="../../../../com/trolltech/qt/QSignalEmitter.Signal9.html" title="type parameter in QSignalEmitter.Signal9">A</A>,<A HREF="../../../../com/trolltech/qt/QSignalEmitter.Signal9.html" title="type parameter in QSignalEmitter.Signal9">B</A>,<A HREF="../../../../com/trolltech/qt/QSignalEmitter.Signal9.html" title="type parameter in QSignalEmitter.Signal9">C</A>,<A HREF="../../../../com/trolltech/qt/QSignalEmitter.Signal9.html" title="type parameter in QSignalEmitter.Signal9">D</A>,<A HREF="../../../../com/trolltech/qt/QSignalEmitter.Signal9.html" title="type parameter in QSignalEmitter.Signal9">E</A>,<A HREF="../../../../com/trolltech/qt/QSignalEmitter.Signal9.html" title="type parameter in QSignalEmitter.Signal9">F</A>,<A HREF="../../../../com/trolltech/qt/QSignalEmitter.Signal9.html" title="type parameter in QSignalEmitter.Signal9">G</A>,<A HREF="../../../../com/trolltech/qt/QSignalEmitter.Signal9.html" title="type parameter in QSignalEmitter.Signal9">H</A>,<A HREF="../../../../com/trolltech/qt/QSignalEmitter.Signal9.html" title="type parameter in QSignalEmitter.Signal9">I</A>&gt;</CODE></TD>
</TR>
</TABLE>
&nbsp;

<!-- ======== CONSTRUCTOR SUMMARY ======== -->

<A NAME="constructor_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Constructor Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="../../../../com/trolltech/qt/gui/QSyntaxHighlighter.html#QSyntaxHighlighter(com.trolltech.qt.core.QObject)">QSyntaxHighlighter</A></B>(<A HREF="../../../../com/trolltech/qt/core/QObject.html" title="class in com.trolltech.qt.core">QObject</A>&nbsp;parent)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Constructs a <a href="QSyntaxHighlighter.html#QSyntaxHighlighter(com.trolltech.qt.gui.QTextEdit)"><tt>QSyntaxHighlighter</tt></a> with the given <tt>parent</tt>.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="../../../../com/trolltech/qt/gui/QSyntaxHighlighter.html#QSyntaxHighlighter(com.trolltech.qt.gui.QTextDocument)">QSyntaxHighlighter</A></B>(<A HREF="../../../../com/trolltech/qt/gui/QTextDocument.html" title="class in com.trolltech.qt.gui">QTextDocument</A>&nbsp;parent)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Constructs a <a href="QSyntaxHighlighter.html#QSyntaxHighlighter(com.trolltech.qt.gui.QTextEdit)"><tt>QSyntaxHighlighter</tt></a> and installs it on <tt>parent</tt>.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="../../../../com/trolltech/qt/gui/QSyntaxHighlighter.html#QSyntaxHighlighter(com.trolltech.qt.gui.QTextEdit)">QSyntaxHighlighter</A></B>(<A HREF="../../../../com/trolltech/qt/gui/QTextEdit.html" title="class in com.trolltech.qt.gui">QTextEdit</A>&nbsp;parent)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Constructs a <a href="QSyntaxHighlighter.html#QSyntaxHighlighter(com.trolltech.qt.gui.QTextEdit)"><tt>QSyntaxHighlighter</tt></a> and installs it on <tt>parent</tt> 's <a href="QTextDocument.html"><tt>QTextDocument</tt></a>.</TD>
</TR>
</TABLE>
&nbsp;
<!-- ========== METHOD SUMMARY =========== -->

<A NAME="method_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Method Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>protected &nbsp;int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../com/trolltech/qt/gui/QSyntaxHighlighter.html#currentBlockState()">currentBlockState</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the state of the current text block.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>protected &nbsp;<A HREF="../../../../com/trolltech/qt/gui/QTextBlockUserData.html" title="class in com.trolltech.qt.gui">QTextBlockUserData</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../com/trolltech/qt/gui/QSyntaxHighlighter.html#currentBlockUserData()">currentBlockUserData</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the <a href="QTextBlockUserData.html"><tt>QTextBlockUserData</tt></a> object previously attached to the current text block.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="../../../../com/trolltech/qt/gui/QTextDocument.html" title="class in com.trolltech.qt.gui">QTextDocument</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../com/trolltech/qt/gui/QSyntaxHighlighter.html#document()">document</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the <a href="QTextDocument.html"><tt>QTextDocument</tt></a> on which this syntax highlighter is installed.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>protected &nbsp;<A HREF="../../../../com/trolltech/qt/gui/QTextCharFormat.html" title="class in com.trolltech.qt.gui">QTextCharFormat</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../com/trolltech/qt/gui/QSyntaxHighlighter.html#format(int)">format</A></B>(int&nbsp;pos)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the format at <tt>pos</tt> inside the syntax highlighter's current text block.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;<A HREF="../../../../com/trolltech/qt/gui/QSyntaxHighlighter.html" title="class in com.trolltech.qt.gui">QSyntaxHighlighter</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../com/trolltech/qt/gui/QSyntaxHighlighter.html#fromNativePointer(com.trolltech.qt.QNativePointer)">fromNativePointer</A></B>(<A HREF="../../../../com/trolltech/qt/QNativePointer.html" title="class in com.trolltech.qt">QNativePointer</A>&nbsp;nativePointer)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;This function returns the QSyntaxHighlighter instance pointed to by nativePointer</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>protected abstract &nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../com/trolltech/qt/gui/QSyntaxHighlighter.html#highlightBlock(java.lang.String)">highlightBlock</A></B>(java.lang.String&nbsp;text)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Highlights the given text block.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>protected &nbsp;int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../com/trolltech/qt/gui/QSyntaxHighlighter.html#previousBlockState()">previousBlockState</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the end state of the text block previous to the syntax highlighter's current block.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../com/trolltech/qt/gui/QSyntaxHighlighter.html#rehighlight()">rehighlight</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Redoes the highlighting of the whole document.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>protected &nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../com/trolltech/qt/gui/QSyntaxHighlighter.html#setCurrentBlockState(int)">setCurrentBlockState</A></B>(int&nbsp;newState)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Sets the state of the current text block to <tt>newState</tt>.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>protected &nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../com/trolltech/qt/gui/QSyntaxHighlighter.html#setCurrentBlockUserData(com.trolltech.qt.gui.QTextBlockUserData)">setCurrentBlockUserData</A></B>(<A HREF="../../../../com/trolltech/qt/gui/QTextBlockUserData.html" title="class in com.trolltech.qt.gui">QTextBlockUserData</A>&nbsp;data)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Attaches the given <tt>data</tt> to the current text block.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../com/trolltech/qt/gui/QSyntaxHighlighter.html#setDocument(com.trolltech.qt.gui.QTextDocument)">setDocument</A></B>(<A HREF="../../../../com/trolltech/qt/gui/QTextDocument.html" title="class in com.trolltech.qt.gui">QTextDocument</A>&nbsp;doc)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Installs the syntax highlighter on the given <a href="QTextDocument.html"><tt>QTextDocument</tt></a> <tt>doc</tt>.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>protected &nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../com/trolltech/qt/gui/QSyntaxHighlighter.html#setFormat(int, int, com.trolltech.qt.gui.QColor)">setFormat</A></B>(int&nbsp;start,
          int&nbsp;count,
          <A HREF="../../../../com/trolltech/qt/gui/QColor.html" title="class in com.trolltech.qt.gui">QColor</A>&nbsp;color)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;The specified <tt>color</tt> is applied to the current text block from the <tt>start</tt> position for a length of <tt>count</tt> characters.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>protected &nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../com/trolltech/qt/gui/QSyntaxHighlighter.html#setFormat(int, int, com.trolltech.qt.gui.QFont)">setFormat</A></B>(int&nbsp;start,
          int&nbsp;count,
          <A HREF="../../../../com/trolltech/qt/gui/QFont.html" title="class in com.trolltech.qt.gui">QFont</A>&nbsp;font)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;The specified <tt>font</tt> is applied to the current text block from the <tt>start</tt> position for a length of <tt>count</tt> characters.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>protected &nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../com/trolltech/qt/gui/QSyntaxHighlighter.html#setFormat(int, int, com.trolltech.qt.gui.QTextCharFormat)">setFormat</A></B>(int&nbsp;start,
          int&nbsp;count,
          <A HREF="../../../../com/trolltech/qt/gui/QTextCharFormat.html" title="class in com.trolltech.qt.gui">QTextCharFormat</A>&nbsp;format)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;This function is applied to the syntax highlighter's current text block (i.e&#x2e; the text that is passed to the <a href="QSyntaxHighlighter.html#highlightBlock(java.lang.String)"><tt>highlightBlock</tt></a> function).</TD>
</TR>
</TABLE>
&nbsp;<A NAME="methods_inherited_from_class_com.trolltech.qt.core.QObject"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TH ALIGN="left"><B>Methods inherited from class com.trolltech.qt.core.<A HREF="../../../../com/trolltech/qt/core/QObject.html" title="class in com.trolltech.qt.core">QObject</A></B></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><A HREF="../../../../com/trolltech/qt/core/QObject.html#blockSignals(boolean)">blockSignals</A>, <A HREF="../../../../com/trolltech/qt/core/QObject.html#childEvent(com.trolltech.qt.core.QChildEvent)">childEvent</A>, <A HREF="../../../../com/trolltech/qt/core/QObject.html#children()">children</A>, <A HREF="../../../../com/trolltech/qt/core/QObject.html#connectSlotsByName()">connectSlotsByName</A>, <A HREF="../../../../com/trolltech/qt/core/QObject.html#customEvent(com.trolltech.qt.core.QEvent)">customEvent</A>, <A HREF="../../../../com/trolltech/qt/core/QObject.html#disposeLater()">disposeLater</A>, <A HREF="../../../../com/trolltech/qt/core/QObject.html#dumpObjectInfo()">dumpObjectInfo</A>, <A HREF="../../../../com/trolltech/qt/core/QObject.html#dumpObjectTree()">dumpObjectTree</A>, <A HREF="../../../../com/trolltech/qt/core/QObject.html#dynamicPropertyNames()">dynamicPropertyNames</A>, <A HREF="../../../../com/trolltech/qt/core/QObject.html#event(com.trolltech.qt.core.QEvent)">event</A>, <A HREF="../../../../com/trolltech/qt/core/QObject.html#eventFilter(com.trolltech.qt.core.QObject, com.trolltech.qt.core.QEvent)">eventFilter</A>, <A HREF="../../../../com/trolltech/qt/core/QObject.html#findChild()">findChild</A>, <A HREF="../../../../com/trolltech/qt/core/QObject.html#findChild(java.lang.Class)">findChild</A>, <A HREF="../../../../com/trolltech/qt/core/QObject.html#findChild(java.lang.Class, java.lang.String)">findChild</A>, <A HREF="../../../../com/trolltech/qt/core/QObject.html#findChildren()">findChildren</A>, <A HREF="../../../../com/trolltech/qt/core/QObject.html#findChildren(java.lang.Class)">findChildren</A>, <A HREF="../../../../com/trolltech/qt/core/QObject.html#findChildren(java.lang.Class, com.trolltech.qt.core.QRegExp)">findChildren</A>, <A HREF="../../../../com/trolltech/qt/core/QObject.html#findChildren(java.lang.Class, java.lang.String)">findChildren</A>, <A HREF="../../../../com/trolltech/qt/core/QObject.html#installEventFilter(com.trolltech.qt.core.QObject)">installEventFilter</A>, <A HREF="../../../../com/trolltech/qt/core/QObject.html#isWidgetType()">isWidgetType</A>, <A HREF="../../../../com/trolltech/qt/core/QObject.html#killTimer(int)">killTimer</A>, <A HREF="../../../../com/trolltech/qt/core/QObject.html#moveToThread(java.lang.Thread)">moveToThread</A>, <A HREF="../../../../com/trolltech/qt/core/QObject.html#objectName()">objectName</A>, <A HREF="../../../../com/trolltech/qt/core/QObject.html#parent()">parent</A>, <A HREF="../../../../com/trolltech/qt/core/QObject.html#property(java.lang.String)">property</A>, <A HREF="../../../../com/trolltech/qt/core/QObject.html#removeEventFilter(com.trolltech.qt.core.QObject)">removeEventFilter</A>, <A HREF="../../../../com/trolltech/qt/core/QObject.html#setObjectName(java.lang.String)">setObjectName</A>, <A HREF="../../../../com/trolltech/qt/core/QObject.html#setParent(com.trolltech.qt.core.QObject)">setParent</A>, <A HREF="../../../../com/trolltech/qt/core/QObject.html#setProperty(java.lang.String, java.lang.Object)">setProperty</A>, <A HREF="../../../../com/trolltech/qt/core/QObject.html#signalsBlocked()">signalsBlocked</A>, <A HREF="../../../../com/trolltech/qt/core/QObject.html#startTimer(int)">startTimer</A>, <A HREF="../../../../com/trolltech/qt/core/QObject.html#thread()">thread</A>, <A HREF="../../../../com/trolltech/qt/core/QObject.html#timerEvent(com.trolltech.qt.core.QTimerEvent)">timerEvent</A></CODE></TD>
</TR>
</TABLE>
&nbsp;<A NAME="methods_inherited_from_class_com.trolltech.qt.QtJambiObject"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TH ALIGN="left"><B>Methods inherited from class com.trolltech.qt.<A HREF="../../../../com/trolltech/qt/QtJambiObject.html" title="class in com.trolltech.qt">QtJambiObject</A></B></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><A HREF="../../../../com/trolltech/qt/QtJambiObject.html#dispose()">dispose</A>, <A HREF="../../../../com/trolltech/qt/QtJambiObject.html#disposed()">disposed</A>, <A HREF="../../../../com/trolltech/qt/QtJambiObject.html#finalize()">finalize</A>, <A HREF="../../../../com/trolltech/qt/QtJambiObject.html#reassignNativeResources(com.trolltech.qt.QtJambiObject, java.lang.Class)">reassignNativeResources</A>, <A HREF="../../../../com/trolltech/qt/QtJambiObject.html#tr(java.lang.String)">tr</A>, <A HREF="../../../../com/trolltech/qt/QtJambiObject.html#tr(java.lang.String, java.lang.String)">tr</A>, <A HREF="../../../../com/trolltech/qt/QtJambiObject.html#tr(java.lang.String, java.lang.String, int)">tr</A></CODE></TD>
</TR>
</TABLE>
&nbsp;<A NAME="methods_inherited_from_class_com.trolltech.qt.QSignalEmitter"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TH ALIGN="left"><B>Methods inherited from class com.trolltech.qt.<A HREF="../../../../com/trolltech/qt/QSignalEmitter.html" title="class in com.trolltech.qt">QSignalEmitter</A></B></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><A HREF="../../../../com/trolltech/qt/QSignalEmitter.html#disconnect()">disconnect</A>, <A HREF="../../../../com/trolltech/qt/QSignalEmitter.html#disconnect(java.lang.Object)">disconnect</A>, <A HREF="../../../../com/trolltech/qt/QSignalEmitter.html#signalSender()">signalSender</A></CODE></TD>
</TR>
</TABLE>
&nbsp;<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TH ALIGN="left"><B>Methods inherited from class java.lang.Object</B></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE>clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</CODE></TD>
</TR>
</TABLE>
&nbsp;<A NAME="methods_inherited_from_class_com.trolltech.qt.QtJambiInterface"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TH ALIGN="left"><B>Methods inherited from interface com.trolltech.qt.<A HREF="../../../../com/trolltech/qt/QtJambiInterface.html" title="interface in com.trolltech.qt">QtJambiInterface</A></B></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><A HREF="../../../../com/trolltech/qt/QtJambiInterface.html#disableGarbageCollection()">disableGarbageCollection</A>, <A HREF="../../../../com/trolltech/qt/QtJambiInterface.html#nativeId()">nativeId</A>, <A HREF="../../../../com/trolltech/qt/QtJambiInterface.html#nativePointer()">nativePointer</A>, <A HREF="../../../../com/trolltech/qt/QtJambiInterface.html#reenableGarbageCollection()">reenableGarbageCollection</A>, <A HREF="../../../../com/trolltech/qt/QtJambiInterface.html#setJavaOwnership()">setJavaOwnership</A></CODE></TD>
</TR>
</TABLE>
&nbsp;
<P>

<!-- ========= CONSTRUCTOR DETAIL ======== -->

<A NAME="constructor_detail"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
<B>Constructor Detail</B></FONT></TH>
</TR>
</TABLE>

<A NAME="QSyntaxHighlighter(com.trolltech.qt.core.QObject)"><!-- --></A><H3>
QSyntaxHighlighter</H3>
<PRE>
public <B>QSyntaxHighlighter</B>(<A HREF="../../../../com/trolltech/qt/core/QObject.html" title="class in com.trolltech.qt.core">QObject</A>&nbsp;parent)</PRE>
<DL>
<DD><p>Constructs a <a href="QSyntaxHighlighter.html#QSyntaxHighlighter(com.trolltech.qt.gui.QTextEdit)"><tt>QSyntaxHighlighter</tt></a> with the given <tt>parent</tt>.</p>
<P>
</DL>
<HR>

<A NAME="QSyntaxHighlighter(com.trolltech.qt.gui.QTextDocument)"><!-- --></A><H3>
QSyntaxHighlighter</H3>
<PRE>
public <B>QSyntaxHighlighter</B>(<A HREF="../../../../com/trolltech/qt/gui/QTextDocument.html" title="class in com.trolltech.qt.gui">QTextDocument</A>&nbsp;parent)</PRE>
<DL>
<DD><p>Constructs a <a href="QSyntaxHighlighter.html#QSyntaxHighlighter(com.trolltech.qt.gui.QTextEdit)"><tt>QSyntaxHighlighter</tt></a> and installs it on <tt>parent</tt>. The specified <a href="QTextDocument.html"><tt>QTextDocument</tt></a> also becomes the owner of the <a href="QSyntaxHighlighter.html#QSyntaxHighlighter(com.trolltech.qt.gui.QTextEdit)"><tt>QSyntaxHighlighter</tt></a>.</p>
<P>
</DL>
<HR>

<A NAME="QSyntaxHighlighter(com.trolltech.qt.gui.QTextEdit)"><!-- --></A><H3>
QSyntaxHighlighter</H3>
<PRE>
public <B>QSyntaxHighlighter</B>(<A HREF="../../../../com/trolltech/qt/gui/QTextEdit.html" title="class in com.trolltech.qt.gui">QTextEdit</A>&nbsp;parent)</PRE>
<DL>
<DD><p>Constructs a <a href="QSyntaxHighlighter.html#QSyntaxHighlighter(com.trolltech.qt.gui.QTextEdit)"><tt>QSyntaxHighlighter</tt></a> and installs it on <tt>parent</tt> 's <a href="QTextDocument.html"><tt>QTextDocument</tt></a>. The specified <a href="QTextEdit.html"><tt>QTextEdit</tt></a> also becomes the owner of the <a href="QSyntaxHighlighter.html#QSyntaxHighlighter(com.trolltech.qt.gui.QTextEdit)"><tt>QSyntaxHighlighter</tt></a>.</p>
<P>
</DL>

<!-- ============ METHOD DETAIL ========== -->

<A NAME="method_detail"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
<B>Method Detail</B></FONT></TH>
</TR>
</TABLE>

<A NAME="currentBlockState()"><!-- --></A><H3>
currentBlockState</H3>
<PRE>
protected final int <B>currentBlockState</B>()</PRE>
<DL>
<DD><p>Returns the state of the current text block. If no value is set, the returned value is -1.</p>
<P>
<DD><DL>
<DT><B>See Also:</B><DD><a href="QSyntaxHighlighter.html#setCurrentBlockState(int)"><tt>setCurrentBlockState</tt></a></DL>
</DD>
</DL>
<HR>

<A NAME="currentBlockUserData()"><!-- --></A><H3>
currentBlockUserData</H3>
<PRE>
protected final <A HREF="../../../../com/trolltech/qt/gui/QTextBlockUserData.html" title="class in com.trolltech.qt.gui">QTextBlockUserData</A> <B>currentBlockUserData</B>()</PRE>
<DL>
<DD><p>Returns the <a href="QTextBlockUserData.html"><tt>QTextBlockUserData</tt></a> object previously attached to the current text block.</p>
<P>
<DD><DL>
<DT><B>See Also:</B><DD><tt>QTextBlock::userData</tt>, 
<a href="QSyntaxHighlighter.html#setCurrentBlockUserData(com.trolltech.qt.gui.QTextBlockUserData)"><tt>setCurrentBlockUserData</tt></a></DL>
</DD>
</DL>
<HR>

<A NAME="document()"><!-- --></A><H3>
document</H3>
<PRE>
public final <A HREF="../../../../com/trolltech/qt/gui/QTextDocument.html" title="class in com.trolltech.qt.gui">QTextDocument</A> <B>document</B>()</PRE>
<DL>
<DD><p>Returns the <a href="QTextDocument.html"><tt>QTextDocument</tt></a> on which this syntax highlighter is installed.</p>
<P>
<DD><DL>
<DT><B>See Also:</B><DD><a href="QSyntaxHighlighter.html#setDocument(com.trolltech.qt.gui.QTextDocument)"><tt>setDocument</tt></a></DL>
</DD>
</DL>
<HR>

<A NAME="format(int)"><!-- --></A><H3>
format</H3>
<PRE>
protected final <A HREF="../../../../com/trolltech/qt/gui/QTextCharFormat.html" title="class in com.trolltech.qt.gui">QTextCharFormat</A> <B>format</B>(int&nbsp;pos)</PRE>
<DL>
<DD><p>Returns the format at <tt>pos</tt> inside the syntax highlighter's current text block.</p>
<P>
<DD><DL>
<DT><B>See Also:</B><DD><a href="QSyntaxHighlighter.html#setFormat(int, int, com.trolltech.qt.gui.QTextCharFormat)"><tt>setFormat</tt></a></DL>
</DD>
</DL>
<HR>

<A NAME="previousBlockState()"><!-- --></A><H3>
previousBlockState</H3>
<PRE>
protected final int <B>previousBlockState</B>()</PRE>
<DL>
<DD><p>Returns the end state of the text block previous to the syntax highlighter's current block. If no value was previously set, the returned value is -1.</p>
<P>
<DD><DL>
<DT><B>See Also:</B><DD><a href="QSyntaxHighlighter.html#highlightBlock(java.lang.String)"><tt>highlightBlock</tt></a>, 
<a href="QSyntaxHighlighter.html#setCurrentBlockState(int)"><tt>setCurrentBlockState</tt></a></DL>
</DD>
</DL>
<HR>

<A NAME="rehighlight()"><!-- --></A><H3>
rehighlight</H3>
<PRE>
public final void <B>rehighlight</B>()</PRE>
<DL>
<DD><p>Redoes the highlighting of the whole document.</p>
<P>
<DD><DL>
</DL>
</DD>
</DL>
<HR>

<A NAME="setCurrentBlockState(int)"><!-- --></A><H3>
setCurrentBlockState</H3>
<PRE>
protected final void <B>setCurrentBlockState</B>(int&nbsp;newState)</PRE>
<DL>
<DD><p>Sets the state of the current text block to <tt>newState</tt>.</p>
<P>
<DD><DL>
<DT><B>See Also:</B><DD><a href="QSyntaxHighlighter.html#currentBlockState()"><tt>currentBlockState</tt></a>, 
<a href="QSyntaxHighlighter.html#highlightBlock(java.lang.String)"><tt>highlightBlock</tt></a></DL>
</DD>
</DL>
<HR>

<A NAME="setCurrentBlockUserData(com.trolltech.qt.gui.QTextBlockUserData)"><!-- --></A><H3>
setCurrentBlockUserData</H3>
<PRE>
protected final void <B>setCurrentBlockUserData</B>(<A HREF="../../../../com/trolltech/qt/gui/QTextBlockUserData.html" title="class in com.trolltech.qt.gui">QTextBlockUserData</A>&nbsp;data)</PRE>
<DL>
<DD><p>Attaches the given <tt>data</tt> to the current text block. The ownership is passed to the underlying text document, i.e&#x2e; the provided <a href="QTextBlockUserData.html"><tt>QTextBlockUserData</tt></a> object will be deleted if the corresponding text block gets deleted.</p>
<p><a href="QTextBlockUserData.html"><tt>QTextBlockUserData</tt></a> can be used to store custom settings. In the case of syntax highlighting, it is in particular interesting as cache storage for information that you may figure out while parsing the paragraph's text.</p>
<p>For example while parsing the text, you can keep track of parenthesis characters that you encounter ('{[(' and the like), and store their relative position and the actual QChar in a simple class derived from <a href="QTextBlockUserData.html"><tt>QTextBlockUserData</tt></a>:</p>
<pre>    struct ParenthesisInfo
    {
        QChar char;
        int position;
    };

    struct BlockData : public QTextBlockUserData
    {
        QVector&lt;ParenthesisInfo&gt; parentheses;
    };</pre>
<p>During cursor navigation in the associated editor, you can ask the current <a href="QTextBlock.html"><tt>QTextBlock</tt></a> (retrieved using the QTextCursor::block() function) if it has a user data object set and cast it to your <tt>BlockData</tt> object. Then you can check if the current cursor position matches with a previously recorded parenthesis position, and, depending on the type of parenthesis (opening or closing), find the next opening or closing parenthesis on the same level.</p>
<p>In this way you can do a visual parenthesis matching and highlight from the current cursor position to the matching parenthesis. That makes it easier to spot a missing parenthesis in your code and to find where a corresponding opening/closing parenthesis is when editing parenthesis intensive code.</p>
<P>
<DD><DL>
<DT><B>See Also:</B><DD><a href="QSyntaxHighlighter.html#currentBlockUserData()"><tt>currentBlockUserData</tt></a>, 
<tt>QTextBlock::setUserData</tt></DL>
</DD>
</DL>
<HR>

<A NAME="setDocument(com.trolltech.qt.gui.QTextDocument)"><!-- --></A><H3>
setDocument</H3>
<PRE>
public final void <B>setDocument</B>(<A HREF="../../../../com/trolltech/qt/gui/QTextDocument.html" title="class in com.trolltech.qt.gui">QTextDocument</A>&nbsp;doc)</PRE>
<DL>
<DD><p>Installs the syntax highlighter on the given <a href="QTextDocument.html"><tt>QTextDocument</tt></a> <tt>doc</tt>. A <a href="QSyntaxHighlighter.html#QSyntaxHighlighter(com.trolltech.qt.gui.QTextEdit)"><tt>QSyntaxHighlighter</tt></a> can only be used with one document at a time.</p>
<P>
<DD><DL>
<DT><B>See Also:</B><DD><a href="QSyntaxHighlighter.html#document()"><tt>document</tt></a></DL>
</DD>
</DL>
<HR>

<A NAME="setFormat(int, int, com.trolltech.qt.gui.QTextCharFormat)"><!-- --></A><H3>
setFormat</H3>
<PRE>
protected final void <B>setFormat</B>(int&nbsp;start,
                               int&nbsp;count,
                               <A HREF="../../../../com/trolltech/qt/gui/QTextCharFormat.html" title="class in com.trolltech.qt.gui">QTextCharFormat</A>&nbsp;format)</PRE>
<DL>
<DD><p>This function is applied to the syntax highlighter's current text block (i.e&#x2e; the text that is passed to the <a href="QSyntaxHighlighter.html#highlightBlock(java.lang.String)"><tt>highlightBlock</tt></a> function).</p>
<p>The specified <tt>format</tt> is applied to the text from the <tt>start</tt> position for a length of <tt>count</tt> characters (if <tt>count</tt> is 0, nothing is done). The formatting properties set in <tt>format</tt> are merged at display time with the formatting information stored directly in the document, for example as previously set with <a href="QTextCursor.html"><tt>QTextCursor</tt></a>'s functions. Note that the document itself remains unmodified by the format set through this function.</p>
<P>
<DD><DL>
<DT><B>See Also:</B><DD><a href="QSyntaxHighlighter.html#format(int)"><tt>format</tt></a>, 
<a href="QSyntaxHighlighter.html#highlightBlock(java.lang.String)"><tt>highlightBlock</tt></a></DL>
</DD>
</DL>
<HR>

<A NAME="setFormat(int, int, com.trolltech.qt.gui.QColor)"><!-- --></A><H3>
setFormat</H3>
<PRE>
protected final void <B>setFormat</B>(int&nbsp;start,
                               int&nbsp;count,
                               <A HREF="../../../../com/trolltech/qt/gui/QColor.html" title="class in com.trolltech.qt.gui">QColor</A>&nbsp;color)</PRE>
<DL>
<DD><p>The specified <tt>color</tt> is applied to the current text block from the <tt>start</tt> position for a length of <tt>count</tt> characters.</p>
<p>The other attributes of the current text block, e.g&#x2e; the font and background color, are reset to default values.</p>
<P>
<DD><DL>
<DT><B>See Also:</B><DD><a href="QSyntaxHighlighter.html#format(int)"><tt>format</tt></a>, 
<a href="QSyntaxHighlighter.html#highlightBlock(java.lang.String)"><tt>highlightBlock</tt></a></DL>
</DD>
</DL>
<HR>

<A NAME="setFormat(int, int, com.trolltech.qt.gui.QFont)"><!-- --></A><H3>
setFormat</H3>
<PRE>
protected final void <B>setFormat</B>(int&nbsp;start,
                               int&nbsp;count,
                               <A HREF="../../../../com/trolltech/qt/gui/QFont.html" title="class in com.trolltech.qt.gui">QFont</A>&nbsp;font)</PRE>
<DL>
<DD><p>The specified <tt>font</tt> is applied to the current text block from the <tt>start</tt> position for a length of <tt>count</tt> characters.</p>
<p>The other attributes of the current text block, e.g&#x2e; the font and background color, are reset to default values.</p>
<P>
<DD><DL>
<DT><B>See Also:</B><DD><a href="QSyntaxHighlighter.html#format(int)"><tt>format</tt></a>, 
<a href="QSyntaxHighlighter.html#highlightBlock(java.lang.String)"><tt>highlightBlock</tt></a></DL>
</DD>
</DL>
<HR>

<A NAME="highlightBlock(java.lang.String)"><!-- --></A><H3>
highlightBlock</H3>
<PRE>
protected abstract void <B>highlightBlock</B>(java.lang.String&nbsp;text)</PRE>
<DL>
<DD><p>Highlights the given text block. This function is called when necessary by the rich text engine, i.e&#x2e; on text blocks which have changed.</p>
<p>To provide your own syntax highlighting, you must subclass <a href="QSyntaxHighlighter.html#QSyntaxHighlighter(com.trolltech.qt.gui.QTextEdit)"><tt>QSyntaxHighlighter</tt></a> and reimplement <a href="QSyntaxHighlighter.html#highlightBlock(java.lang.String)"><tt>highlightBlock</tt></a>. In your reimplementation you should parse the block's <tt>text</tt> and call <a href="QSyntaxHighlighter.html#setFormat(int, int, com.trolltech.qt.gui.QTextCharFormat)"><tt>setFormat</tt></a> as often as necessary to apply any font and color changes that you require. For example:</p>
<pre>    void MyHighlighter::highlightBlock(const QString &amp;text)
    {
        QTextCharFormat myClassFormat;
        myClassFormat.setFontWeight(QFont::Bold);
        myClassFormat.setForeground(Qt::darkMagenta);
        QString pattern = &quot;\\bMy[A-Za-z]+\\b&quot;;

        QRegExp expression(pattern);
        int index = text.indexOf(expression);
        while (index &gt;= 0) {
            int length = expression.matchedLength();
            setFormat(index, length, myClassFormat);
            index = text.indexOf(expression, index + length);
         }
     }</pre>
<p>Some syntaxes can have constructs that span several text blocks. For example, a C++ syntax highlighter should be able to cope with <tt>/</tt><tt>*...*</tt><tt>/</tt> multiline comments. To deal with these cases it is necessary to know the end state of the previous text block (e.g&#x2e; &quot;in comment&quot;).</p>
<p>Inside your <a href="QSyntaxHighlighter.html#highlightBlock(java.lang.String)"><tt>highlightBlock</tt></a> implementation you can query the end state of the previous text block using the <a href="QSyntaxHighlighter.html#previousBlockState()"><tt>previousBlockState</tt></a> function. After parsing the block you can save the last state using <a href="QSyntaxHighlighter.html#setCurrentBlockState(int)"><tt>setCurrentBlockState</tt></a>.</p>
<p>The <a href="QSyntaxHighlighter.html#currentBlockState()"><tt>currentBlockState</tt></a> and <a href="QSyntaxHighlighter.html#previousBlockState()"><tt>previousBlockState</tt></a> functions return an int value. If no state is set, the returned value is -1. You can designate any other value to identify any given state using the <a href="QSyntaxHighlighter.html#setCurrentBlockState(int)"><tt>setCurrentBlockState</tt></a> function. Once the state is set the <a href="QTextBlock.html"><tt>QTextBlock</tt></a> keeps that value until it is set set again or until the corresponding paragraph of text gets deleted.</p>
<p>For example, if you're writing a simple C++ syntax highlighter, you might designate 1 to signify &quot;in comment&quot;. For a text block that ended in the middle of a comment you'd set 1 using <a href="QSyntaxHighlighter.html#setCurrentBlockState(int)"><tt>setCurrentBlockState</tt></a>, and for other paragraphs you'd set 0. In your parsing code if the return value of <a href="QSyntaxHighlighter.html#previousBlockState()"><tt>previousBlockState</tt></a> is 1, you would highlight the text as a C++ comment until you reached the closing <tt>*</tt><tt>/</tt>.</p>
<P>
<DD><DL>
<DT><B>See Also:</B><DD><a href="QSyntaxHighlighter.html#previousBlockState()"><tt>previousBlockState</tt></a>, 
<a href="QSyntaxHighlighter.html#setFormat(int, int, com.trolltech.qt.gui.QTextCharFormat)"><tt>setFormat</tt></a>, 
<a href="QSyntaxHighlighter.html#setCurrentBlockState(int)"><tt>setCurrentBlockState</tt></a></DL>
</DD>
</DL>
<HR>

<A NAME="fromNativePointer(com.trolltech.qt.QNativePointer)"><!-- --></A><H3>
fromNativePointer</H3>
<PRE>
public static <A HREF="../../../../com/trolltech/qt/gui/QSyntaxHighlighter.html" title="class in com.trolltech.qt.gui">QSyntaxHighlighter</A> <B>fromNativePointer</B>(<A HREF="../../../../com/trolltech/qt/QNativePointer.html" title="class in com.trolltech.qt">QNativePointer</A>&nbsp;nativePointer)</PRE>
<DL>
<DD>This function returns the QSyntaxHighlighter instance pointed to by nativePointer
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>nativePointer</CODE> - the QNativePointer of which object should be returned.</DL>
</DD>
</DL>
<!-- ========= END OF CLASS DATA ========= -->
<HR>


<!-- ======= START OF BOTTOM NAVBAR ====== -->
<A NAME="navbar_bottom"><!-- --></A>
<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_bottom_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
  <TR ALIGN="center" VALIGN="top">
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
  </TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>

<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;<A HREF="../../../../com/trolltech/qt/gui/QStylePainter.html" title="class in com.trolltech.qt.gui"><B>PREV CLASS</B></A>&nbsp;
&nbsp;<A HREF="../../../../com/trolltech/qt/gui/QSystemTrayIcon.html" title="class in com.trolltech.qt.gui"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
  <A HREF="../../../../index.html?com/trolltech/qt/gui/QSyntaxHighlighter.html" target="_top"><B>FRAMES</B></A>  &nbsp;
&nbsp;<A HREF="QSyntaxHighlighter.html" target="_top"><B>NO FRAMES</B></A>  &nbsp;
&nbsp;<SCRIPT type="text/javascript">
  <!--
  if(window==top) {
    document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>');
  }
  //-->
</SCRIPT>
<NOSCRIPT>
  <A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>


</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
  SUMMARY:&nbsp;<A HREF="#nested_classes_inherited_from_class_com.trolltech.qt.QSignalEmitter">NESTED</A>&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL:&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_bottom"></A>
<!-- ======== END OF BOTTOM NAVBAR ======= -->

<HR>

</BODY>
</HTML>