Sophie

Sophie

distrib > Fedora > 15 > i386 > by-pkgid > 1f9eb832ba1e4b88d9a5c2b384813bb4 > files > 6698

kdelibs3-apidocs-3.5.10-31.fc15.noarch.rpm

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en_US" xml:lang="en_US">

<head>
  <title>kutils: KFind Class Reference (kutils)</title>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

  <meta http-equiv="Content-Style-Type" content="text/css" />

  <meta http-equiv="pics-label" content='(pics-1.1 "http://www.icra.org/ratingsv02.html" comment "ICRAonline DE v2.0" l gen true for "http://www.kde.org"  r (nz 1 vz 1 lz 1 oz 1 cb 1) "http://www.rsac.org/ratingsv01.html" l gen true for "http://www.kde.org"  r (n 0 s 0 v 0 l 0))' />

  <meta name="trademark" content="KDE e.V." />
  <meta name="description" content="K Desktop Environment Homepage, KDE.org" />
  <meta name="MSSmartTagsPreventParsing" content="true" />
  <meta name="robots" content="all" />

  <link rel="shortcut icon" href="../../favicon.ico" />

<link rel="stylesheet" media="screen" type="text/css" title="APIDOX" href="doxygen.css" />



</head>

<body>

<div id="nav_header_top" align="right">
  <a href="#content" class="doNotDisplay" accesskey="2">Skip to main content ::</a>

  <a href="../.."><img id="nav_header_logo" alt="Home" align="left" src="../../kde_gear_64.png" border="0" /></a>
  <span class="doNotDisplay">::</span>

  <div id="nav_header_title" align="left">KDE API Reference</div>


</div>

<div id="nav_header_bottom" align="right">
  <span class="doNotDisplay">:: <a href="#navigation" accesskey="5">Skip to Link Menu</a><br/></span>
  <div id="nav_header_bottom_right" style="text-align: left;">
/ <a href="../..">API Reference</a>
 / <a href=".">kutils</a>
  </div>
</div>


<table id="main" border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
      <td valign="top" class="menuheader" height="0"></td>

  <td id="contentcolumn" valign="top" rowspan="2" >
    <div id="content" style="padding-top: 0px;"><div style="width:100%; margin: 0px; padding: 0px;">
    <a name="content"></a>


<!-- Generated by Doxygen 1.7.4 -->
</div>
<div class="header">
  <div class="summary">
<a href="#pub-types">Public Types</a> &#124;
<a href="#signals">Signals</a> &#124;
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pub-static-methods">Static Public Member Functions</a> &#124;
<a href="#pro-slots">Protected Slots</a> &#124;
<a href="#pro-methods">Protected Member Functions</a> &#124;
<a href="#friends">Friends</a>  </div>
  <div class="headertitle">
<div class="title">KFind Class Reference<div class="ingroups"><a class="el" href="group__main.html">Main classes</a> &#124; <a class="el" href="group__findreplace.html">Find and Replace classes</a></div></div>  </div>
</div>
<div class="contents">
<!-- doxytag: class="KFind" --><!-- doxytag: inherits="QObject" -->
<p>A generic implementation of the "find" function.  
 <a href="classKFind.html#details">More...</a></p>

<p><code>#include &lt;<a class="el" href="kfind_8h_source.html">kfind.h</a>&gt;</code></p>
<div class="dynheader">
Inheritance diagram for KFind:</div>
<div class="dyncontent">
 <div class="center">
  <img src="classKFind.png" usemap="#KFind_map" alt=""/>
  <map id="KFind_map" name="KFind_map">
<area href="qobject.html" alt="QObject" shape="rect" coords="0,0,66,24"/>
<area href="classKReplace.html" title="A generic implementation of the &quot;replace&quot; function." alt="KReplace" shape="rect" coords="0,112,66,136"/>
</map>
 </div></div>

<p><a href="classKFind-members.html">List of all members.</a></p>
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="pub-types"></a>
Public Types</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classKFind.html#a40a6b946c7c572127a8bc03f0983086f">Result</a> { <a class="el" href="classKFind.html#a40a6b946c7c572127a8bc03f0983086faba61fbb9416d27f4ca375335f6aadf5a">NoMatch</a>, 
<a class="el" href="classKFind.html#a40a6b946c7c572127a8bc03f0983086fafbed2acec3f17225b88e7e8d7d4a6027">Match</a>
 }</td></tr>
<tr><td colspan="2"><h2><a name="signals"></a>
Signals</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classKFind.html#af66e494430aa005f66f08052ed82b0e9">highlight</a> (const <a class="elRef" href="qstring.html">QString</a> &amp;text, int matchingIndex, int matchedLength)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classKFind.html#a657f5d8ff4bfaf4fbdcb06f31ce0951b">highlight</a> (int id, int matchingIndex, int matchedLength)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a8dda59166d3c8893737675328312c7a9"></a><!-- doxytag: member="KFind::findNext" ref="a8dda59166d3c8893737675328312c7a9" args="()" -->
void&#160;</td><td class="memItemRight" valign="bottom"><b>findNext</b> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classKFind.html#a8930ac96f7c34f1c2a923f423b78ae80">optionsChanged</a> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classKFind.html#a7b8095f6465290037a18fb10e55303bc">dialogClosed</a> ()</td></tr>
<tr><td colspan="2"><h2><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classKFind.html#abf8d9a3d3e1901468b73b4c9fc84c15b">KFind</a> (const <a class="elRef" href="qstring.html">QString</a> &amp;pattern, long options, <a class="elRef" href="qwidget.html">QWidget</a> *<a class="elRef" href="qobject.html#parent">parent</a>)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classKFind.html#a0be9aa46e4e9a76a6895573e8f35f8fe">KFind</a> (const <a class="elRef" href="qstring.html">QString</a> &amp;pattern, long options, <a class="elRef" href="qwidget.html">QWidget</a> *<a class="elRef" href="qobject.html#parent">parent</a>, <a class="elRef" href="qwidget.html">QWidget</a> *findDialog)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classKFind.html#a57d3de5351a9271151bc7f7b11420fae">~KFind</a> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classKFind.html#ac2aa31c56ce6137e2c15672643ec0d39">needData</a> () const </td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classKFind.html#ac806c7431ccf4322b527503bc2017a38">setData</a> (const <a class="elRef" href="qstring.html">QString</a> &amp;data, int startPos=-1)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classKFind.html#a00e99cbb31eb7db6ea7f9742214140ff">setData</a> (int id, const <a class="elRef" href="qstring.html">QString</a> &amp;data, int startPos=-1)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="classKFind.html#a40a6b946c7c572127a8bc03f0983086f">Result</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classKFind.html#aeca9357cf928ce7bf0e63e695e13572e">find</a> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">long&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classKFind.html#a5aac4ccbdf73d8ee87c332f7e41484c2">options</a> () const </td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classKFind.html#ab81a0a207642b5040b7f70aa7554e2a6">setOptions</a> (long options)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="elRef" href="qstring.html">QString</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classKFind.html#a56d66f34345ae798fc561ad13336a779">pattern</a> () const </td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classKFind.html#a6def3ea12954905ddaef3ebf39ced2b5">setPattern</a> (const <a class="elRef" href="qstring.html">QString</a> &amp;pattern)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classKFind.html#a48e3acd3fc80b9209789b25269c5ece2">numMatches</a> () const </td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classKFind.html#afb374c90fc8ee5c1f21f84d934b0df35">resetCounts</a> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classKFind.html#a469e02f43c69769b3f4c3c815241a69d">validateMatch</a> (const <a class="elRef" href="qstring.html">QString</a> &amp;text, int index, int matchedlength)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classKFind.html#a0cdf16a51c2ddd48d647ef20faf4c5a8">shouldRestart</a> (bool forceAsking=false, bool showNumMatches=true) const </td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classKFind.html#afe38e946ffcdbfcc60597bd80e5dd032">displayFinalDialog</a> () const </td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="elRef" doxygen="kdeui.tag:../../kdeui/html/" href="../../kdeui/html/classKDialogBase.html">KDialogBase</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classKFind.html#a27f97b3e09a67a156655e7a7b81ea871">findNextDialog</a> (bool create=false)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classKFind.html#a7463d233cf533cab1517a04a2bee0d59">closeFindNextDialog</a> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classKFind.html#a9000c1387affd5f1e95b81b6136cec3a">index</a> () const </td></tr>
<tr><td colspan="2"><h2><a name="pub-static-methods"></a>
Static Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">static int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classKFind.html#a1ce04dfdc7e2ee4117743fcf9a41d3e4">find</a> (const <a class="elRef" href="qstring.html">QString</a> &amp;text, const <a class="elRef" href="qstring.html">QString</a> &amp;pattern, int index, long options, int *matchedlength)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">static int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classKFind.html#acccfd8b9bfe82bf8cb6b1b20257cd718">find</a> (const <a class="elRef" href="qstring.html">QString</a> &amp;text, const <a class="elRef" href="qregexp.html">QRegExp</a> &amp;pattern, int index, long options, int *matchedlength)</td></tr>
<tr><td colspan="2"><h2><a name="pro-slots"></a>
Protected Slots</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a26a586cee651921df2bb255552ee8451"></a><!-- doxytag: member="KFind::slotFindNext" ref="a26a586cee651921df2bb255552ee8451" args="()" -->
void&#160;</td><td class="memItemRight" valign="bottom"><b>slotFindNext</b> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a63d9775035c980ee45188f7777ff766e"></a><!-- doxytag: member="KFind::slotDialogClosed" ref="a63d9775035c980ee45188f7777ff766e" args="()" -->
void&#160;</td><td class="memItemRight" valign="bottom"><b>slotDialogClosed</b> ()</td></tr>
<tr><td colspan="2"><h2><a name="pro-methods"></a>
Protected Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a847ce58308ec2d5b03acab2092d3b903"></a><!-- doxytag: member="KFind::parentWidget" ref="a847ce58308ec2d5b03acab2092d3b903" args="() const " -->
<a class="elRef" href="qwidget.html">QWidget</a> *&#160;</td><td class="memItemRight" valign="bottom"><b>parentWidget</b> () const </td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a05708f0b2a73aa2a2e6d952faebebe0f"></a><!-- doxytag: member="KFind::dialogsParent" ref="a05708f0b2a73aa2a2e6d952faebebe0f" args="() const " -->
<a class="elRef" href="qwidget.html">QWidget</a> *&#160;</td><td class="memItemRight" valign="bottom"><b>dialogsParent</b> () const </td></tr>
<tr><td colspan="2"><h2><a name="friends"></a>
Friends</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a1e801c845634e887e0fc2df5e3360827"></a><!-- doxytag: member="KFind::KReplace" ref="a1e801c845634e887e0fc2df5e3360827" args="" -->
class&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classKFind.html#a1e801c845634e887e0fc2df5e3360827">KReplace</a></td></tr>
</table>
<hr/><a name="details" id="details"></a><h2>Detailed Description</h2>
<div class="textblock"><p>A generic implementation of the "find" function. </p>
<dl class="author"><dt><b>Author:</b></dt><dd>S.R.Haque &lt;<a href="mailto:srhaque@iee.org">srhaque@iee.org</a>&gt;, David Faure &lt;<a href="mailto:faure@kde.org">faure@kde.org</a>&gt;, Arend van Beelen jr. &lt;<a href="mailto:arend@auton.nl">arend@auton.nl</a>&gt;</dd></dl>
<p><b>Detail:</b> </p>
<p>This class includes prompt handling etc. Also provides some static functions which can be used to create custom behavior instead of using the class directly.</p>
<p><b>Example:</b> </p>
<p>To use the class to implement a complete find feature:</p>
<p>In the slot connected to the find action, after using <a class="el" href="classKFindDialog.html" title="A generic &quot;find&quot; dialog.">KFindDialog</a>: </p>
<div class="fragment"><pre class="fragment">  <span class="comment">// This creates a find-next-prompt dialog if needed.</span>
  m_find = <span class="keyword">new</span> <a class="code" href="classKFind.html#abf8d9a3d3e1901468b73b4c9fc84c15b" title="Only use this constructor if you don&#39;t use KFindDialog, or if you use it as a modal dialog...">KFind</a>(<a class="code" href="classKFind.html#a56d66f34345ae798fc561ad13336a779">pattern</a>, <a class="code" href="classKFind.html#a5aac4ccbdf73d8ee87c332f7e41484c2" title="Return the current options.">options</a>, <span class="keyword">this</span>);

  <span class="comment">// Connect highlight signal to code which handles highlighting</span>
  <span class="comment">// of found text.</span>
  <a class="codeRef" href="qobject.html#connect">connect</a>( m_find, SIGNAL( <a class="code" href="classKFind.html#af66e494430aa005f66f08052ed82b0e9" title="Connect to this signal to implement highlighting of found text during the find operation.">highlight</a>( <span class="keyword">const</span> <a class="codeRef" href="qstring.html">QString</a> &amp;, <span class="keywordtype">int</span>, <span class="keywordtype">int</span> ) ),
          <span class="keyword">this</span>, SLOT( slotHighlight( <span class="keyword">const</span> <a class="codeRef" href="qstring.html">QString</a> &amp;, <span class="keywordtype">int</span>, <span class="keywordtype">int</span> ) ) );
  <span class="comment">// Connect findNext signal - called when pressing the button in the dialog</span>
  <a class="codeRef" href="qobject.html#connect">connect</a>( m_find, SIGNAL( findNext() ),
          <span class="keyword">this</span>, SLOT( slotFindNext() ) );
</pre></div><p>If you are using a non-modal find dialog (the recommended new way in KDE-3.2), you should call right away m_find-&gt;<a class="el" href="classKFind.html#a7463d233cf533cab1517a04a2bee0d59" title="Close the &quot;find next?&quot; dialog.">closeFindNextDialog()</a>.</p>
<p>Then initialize the variables determining the "current position" (to the cursor, if the option FromCursor is set, to the beginning of the selection if the option SelectedText is set, and to the beginning of the document otherwise). Initialize the "end of search" variables as well (end of doc or end of selection). Swap begin and end if FindBackwards. Finally, call slotFindNext();</p>
<div class="fragment"><pre class="fragment">  <span class="keywordtype">void</span> slotFindNext()
  {
      <a class="code" href="classKFind.html#a40a6b946c7c572127a8bc03f0983086f" title="Result enum.">KFind::Result</a> res = <a class="code" href="classKFind.html#a40a6b946c7c572127a8bc03f0983086faba61fbb9416d27f4ca375335f6aadf5a" title="No match was found.">KFind::NoMatch</a>;
      <span class="keywordflow">while</span> ( res == <a class="code" href="classKFind.html#a40a6b946c7c572127a8bc03f0983086faba61fbb9416d27f4ca375335f6aadf5a" title="No match was found.">KFind::NoMatch</a> &amp;&amp; &lt;position not at end&gt; ) {
          <span class="keywordflow">if</span> ( m_find-&gt;needData() )
              m_find-&gt;setData( &lt;current text fragment&gt; );

          <span class="comment">// Let KFind inspect the text fragment, and display a dialog if a match is found</span>
          res = m_find-&gt;find();

          <span class="keywordflow">if</span> ( res == <a class="code" href="classKFind.html#a40a6b946c7c572127a8bc03f0983086faba61fbb9416d27f4ca375335f6aadf5a" title="No match was found.">KFind::NoMatch</a> ) {
              &lt;Move to the <a class="codeRef" doxygen="kdecore.tag:../../kdecore/html/" href="../../kdecore/html/namespaceKStdAccel.html#a3c93cec83afd9c54d443fe78a9899502">next</a> text fragment, honoring the FindBackwards setting <span class="keywordflow">for</span> the direction&gt;
          }
      }

      <span class="keywordflow">if</span> ( res == <a class="code" href="classKFind.html#a40a6b946c7c572127a8bc03f0983086faba61fbb9416d27f4ca375335f6aadf5a" title="No match was found.">KFind::NoMatch</a> ) <span class="comment">// i.e. at end</span>
          &lt;Call either  m_find-&gt;displayFinalDialog(); <span class="keyword">delete</span> m_find; m_find = 0L;
           or           <span class="keywordflow">if</span> ( m_find-&gt;shouldRestart() ) { reinit (w/o FromCursor) and call slotFindNext(); }
                        <span class="keywordflow">else</span> { m_find-&gt;closeFindNextDialog(); }&gt;
  }
</pre></div><p>Don't forget to delete m_find in the destructor of your class, unless you gave it a parent widget on construction.</p>
<p>This implementation allows to have a "Find Next" action, which resumes the search, even if the user closed the "Find Next" dialog.</p>
<p>A "Find Previous" action can simply switch temporarily the value of FindBackwards and call slotFindNext() - and reset the value afterwards. </p>

<p>Definition at line <a class="el" href="kfind_8h_source.html#l00103">103</a> of file <a class="el" href="kfind_8h_source.html">kfind.h</a>.</p>
</div><hr/><h2>Member Enumeration Documentation</h2>
<a class="anchor" id="a40a6b946c7c572127a8bc03f0983086f"></a><!-- doxytag: member="KFind::Result" ref="a40a6b946c7c572127a8bc03f0983086f" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">enum <a class="el" href="classKFind.html#a40a6b946c7c572127a8bc03f0983086f">KFind::Result</a></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Result enum. </p>
<p>Holds information if the find was successful. </p>
<dl><dt><b>Enumerator: </b></dt><dd><table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><em><a class="anchor" id="a40a6b946c7c572127a8bc03f0983086faba61fbb9416d27f4ca375335f6aadf5a"></a><!-- doxytag: member="NoMatch" ref="a40a6b946c7c572127a8bc03f0983086faba61fbb9416d27f4ca375335f6aadf5a" args="" -->NoMatch</em>&nbsp;</td><td>
<p>No match was found. </p>
</td></tr>
<tr><td valign="top"><em><a class="anchor" id="a40a6b946c7c572127a8bc03f0983086fafbed2acec3f17225b88e7e8d7d4a6027"></a><!-- doxytag: member="Match" ref="a40a6b946c7c572127a8bc03f0983086fafbed2acec3f17225b88e7e8d7d4a6027" args="" -->Match</em>&nbsp;</td><td>
<p>A match was found. </p>
</td></tr>
</table>
</dd>
</dl>

<p>Definition at line <a class="el" href="kfind_8h_source.html#l00139">139</a> of file <a class="el" href="kfind_8h_source.html">kfind.h</a>.</p>

</div>
</div>
<hr/><h2>Constructor &amp; Destructor Documentation</h2>
<a class="anchor" id="abf8d9a3d3e1901468b73b4c9fc84c15b"></a><!-- doxytag: member="KFind::KFind" ref="abf8d9a3d3e1901468b73b4c9fc84c15b" args="(const QString &amp;pattern, long options, QWidget *parent)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">KFind::KFind </td>
          <td>(</td>
          <td class="paramtype">const <a class="elRef" href="qstring.html">QString</a> &amp;&#160;</td>
          <td class="paramname"><em>pattern</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">long&#160;</td>
          <td class="paramname"><em>options</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="elRef" href="qwidget.html">QWidget</a> *&#160;</td>
          <td class="paramname"><em>parent</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Only use this constructor if you don't use <a class="el" href="classKFindDialog.html" title="A generic &quot;find&quot; dialog.">KFindDialog</a>, or if you use it as a modal dialog. </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">pattern</td><td>The pattern to look for. </td></tr>
    <tr><td class="paramname">options</td><td>Options for the find dialog. </td></tr>
  </table>
  </dd>
</dl>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classKFindDialog.html" title="A generic &quot;find&quot; dialog.">KFindDialog</a>. </dd></dl>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">parent</td><td>The parent widget. </td></tr>
  </table>
  </dd>
</dl>

<p>Definition at line <a class="el" href="kfind_8cpp_source.html#l00118">118</a> of file <a class="el" href="kfind_8cpp_source.html">kfind.cpp</a>.</p>

</div>
</div>
<a class="anchor" id="a0be9aa46e4e9a76a6895573e8f35f8fe"></a><!-- doxytag: member="KFind::KFind" ref="a0be9aa46e4e9a76a6895573e8f35f8fe" args="(const QString &amp;pattern, long options, QWidget *parent, QWidget *findDialog)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">KFind::KFind </td>
          <td>(</td>
          <td class="paramtype">const <a class="elRef" href="qstring.html">QString</a> &amp;&#160;</td>
          <td class="paramname"><em>pattern</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">long&#160;</td>
          <td class="paramname"><em>options</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="elRef" href="qwidget.html">QWidget</a> *&#160;</td>
          <td class="paramname"><em>parent</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="elRef" href="qwidget.html">QWidget</a> *&#160;</td>
          <td class="paramname"><em>findDialog</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>This is the recommended constructor if you also use <a class="el" href="classKFindDialog.html" title="A generic &quot;find&quot; dialog.">KFindDialog</a> (non-modal). </p>
<p>You should pass the pointer to it here, so that when a message box appears it has the right parent. Don't worry about deletion, <a class="el" href="classKFind.html" title="A generic implementation of the &quot;find&quot; function.">KFind</a> will notice if the find dialog is closed. </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">pattern</td><td>The pattern to look for. </td></tr>
    <tr><td class="paramname">options</td><td>Options for the find dialog. </td></tr>
  </table>
  </dd>
</dl>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classKFindDialog.html" title="A generic &quot;find&quot; dialog.">KFindDialog</a>. </dd></dl>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">parent</td><td>The parent widget. </td></tr>
    <tr><td class="paramname">findDialog</td><td>A pointer to the <a class="el" href="classKFindDialog.html" title="A generic &quot;find&quot; dialog.">KFindDialog</a> object. </td></tr>
  </table>
  </dd>
</dl>

<p>Definition at line <a class="el" href="kfind_8cpp_source.html#l00126">126</a> of file <a class="el" href="kfind_8cpp_source.html">kfind.cpp</a>.</p>

</div>
</div>
<a class="anchor" id="a57d3de5351a9271151bc7f7b11420fae"></a><!-- doxytag: member="KFind::~KFind" ref="a57d3de5351a9271151bc7f7b11420fae" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">KFind::~KFind </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td><code> [virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Destructor. </p>

<p>Definition at line <a class="el" href="kfind_8cpp_source.html#l00150">150</a> of file <a class="el" href="kfind_8cpp_source.html">kfind.cpp</a>.</p>

</div>
</div>
<hr/><h2>Member Function Documentation</h2>
<a class="anchor" id="a7463d233cf533cab1517a04a2bee0d59"></a><!-- doxytag: member="KFind::closeFindNextDialog" ref="a7463d233cf533cab1517a04a2bee0d59" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void KFind::closeFindNextDialog </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Close the "find next?" dialog. </p>
<p>The application should do this when the last match was hit. If the application deletes the <a class="el" href="classKFind.html" title="A generic implementation of the &quot;find&quot; function.">KFind</a>, then "find previous" won't be possible anymore.</p>
<p>IMPORTANT: you should also call this if you are using a non-modal find dialog, to tell <a class="el" href="classKFind.html" title="A generic implementation of the &quot;find&quot; function.">KFind</a> not to pop up its own dialog. </p>

<p>Definition at line <a class="el" href="kfind_8cpp_source.html#l00681">681</a> of file <a class="el" href="kfind_8cpp_source.html">kfind.cpp</a>.</p>

</div>
</div>
<a class="anchor" id="a7b8095f6465290037a18fb10e55303bc"></a><!-- doxytag: member="KFind::dialogClosed" ref="a7b8095f6465290037a18fb10e55303bc" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void KFind::dialogClosed </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td><code> [signal]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Emitted when the 'find next' dialog is being closed. </p>
<p>Some apps might want to remove the highlighted text when this happens. Apps without support for "Find Next" can also do m_find-&gt;<a class="elRef" href="qobject.html#deleteLater">deleteLater()</a> to terminate the find operation. </p>

</div>
</div>
<a class="anchor" id="afe38e946ffcdbfcc60597bd80e5dd032"></a><!-- doxytag: member="KFind::displayFinalDialog" ref="afe38e946ffcdbfcc60597bd80e5dd032" args="() const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void KFind::displayFinalDialog </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const<code> [virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Displays the final dialog saying "no match was found", if that was the case. </p>
<p>Call either this or <a class="el" href="classKFind.html#a0cdf16a51c2ddd48d647ef20faf4c5a8" title="Returns true if we should restart the search from scratch.">shouldRestart()</a>. </p>

<p>Reimplemented in <a class="el" href="classKReplace.html#a97ff667380c4adb8916bd0cbcf96f512">KReplace</a>.</p>

<p>Definition at line <a class="el" href="kfind_8cpp_source.html#l00619">619</a> of file <a class="el" href="kfind_8cpp_source.html">kfind.cpp</a>.</p>

</div>
</div>
<a class="anchor" id="aeca9357cf928ce7bf0e63e695e13572e"></a><!-- doxytag: member="KFind::find" ref="aeca9357cf928ce7bf0e63e695e13572e" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classKFind.html#a40a6b946c7c572127a8bc03f0983086f">KFind::Result</a> KFind::find </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Walk the text fragment (e.g. </p>
<p>text-processor line, kspread cell) looking for matches. For each match, emits the <a class="el" href="classKFind.html#af66e494430aa005f66f08052ed82b0e9" title="Connect to this signal to implement highlighting of found text during the find operation.">highlight()</a> signal and displays the find-again dialog proceeding. </p>
<dl class="return"><dt><b>Returns:</b></dt><dd>Whether or not there has been a match. </dd></dl>

<p>Definition at line <a class="el" href="kfind_8cpp_source.html#l00221">221</a> of file <a class="el" href="kfind_8cpp_source.html">kfind.cpp</a>.</p>

</div>
</div>
<a class="anchor" id="a1ce04dfdc7e2ee4117743fcf9a41d3e4"></a><!-- doxytag: member="KFind::find" ref="a1ce04dfdc7e2ee4117743fcf9a41d3e4" args="(const QString &amp;text, const QString &amp;pattern, int index, long options, int *matchedlength)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int KFind::find </td>
          <td>(</td>
          <td class="paramtype">const <a class="elRef" href="qstring.html">QString</a> &amp;&#160;</td>
          <td class="paramname"><em>text</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="elRef" href="qstring.html">QString</a> &amp;&#160;</td>
          <td class="paramname"><em>pattern</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>index</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">long&#160;</td>
          <td class="paramname"><em>options</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int *&#160;</td>
          <td class="paramname"><em>matchedlength</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td><code> [static]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Search the given string, and returns whether a match was found. </p>
<p>If one is, the length of the string matched is also returned.</p>
<p>A performance optimised version of the function is provided for use with regular expressions.</p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">text</td><td>The string to search. </td></tr>
    <tr><td class="paramname">pattern</td><td>The pattern to look for. </td></tr>
    <tr><td class="paramname">index</td><td>The starting index into the string. </td></tr>
    <tr><td class="paramname">options</td><td>The options to use. </td></tr>
    <tr><td class="paramname">matchedlength</td><td>The length of the string that was matched </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>The index at which a match was found, or -1 if no match was found. </dd></dl>

<p>Definition at line <a class="el" href="kfind_8cpp_source.html#l00454">454</a> of file <a class="el" href="kfind_8cpp_source.html">kfind.cpp</a>.</p>

</div>
</div>
<a class="anchor" id="acccfd8b9bfe82bf8cb6b1b20257cd718"></a><!-- doxytag: member="KFind::find" ref="acccfd8b9bfe82bf8cb6b1b20257cd718" args="(const QString &amp;text, const QRegExp &amp;pattern, int index, long options, int *matchedlength)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int KFind::find </td>
          <td>(</td>
          <td class="paramtype">const <a class="elRef" href="qstring.html">QString</a> &amp;&#160;</td>
          <td class="paramname"><em>text</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="elRef" href="qregexp.html">QRegExp</a> &amp;&#160;</td>
          <td class="paramname"><em>pattern</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>index</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">long&#160;</td>
          <td class="paramname"><em>options</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int *&#160;</td>
          <td class="paramname"><em>matchedlength</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td><code> [static]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Search the given regular expression, and returns whether a match was found. </p>
<p>If one is, the length of the matched string is also returned.</p>
<p>Another version of the function is provided for use with strings.</p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">text</td><td>The string to search. </td></tr>
    <tr><td class="paramname">pattern</td><td>The regular expression pattern to look for. </td></tr>
    <tr><td class="paramname">index</td><td>The starting index into the string. </td></tr>
    <tr><td class="paramname">options</td><td>The options to use. </td></tr>
    <tr><td class="paramname">matchedlength</td><td>The length of the string that was matched </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>The index at which a match was found, or -1 if no match was found. </dd></dl>

<p>Definition at line <a class="el" href="kfind_8cpp_source.html#l00525">525</a> of file <a class="el" href="kfind_8cpp_source.html">kfind.cpp</a>.</p>

</div>
</div>
<a class="anchor" id="a27f97b3e09a67a156655e7a7b81ea871"></a><!-- doxytag: member="KFind::findNextDialog" ref="a27f97b3e09a67a156655e7a7b81ea871" args="(bool create=false)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="elRef" doxygen="kdeui.tag:../../kdeui/html/" href="../../kdeui/html/classKDialogBase.html">KDialogBase</a> * KFind::findNextDialog </td>
          <td>(</td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>create</em> = <code>false</code></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Return (or create) the dialog that shows the "find next?" prompt. </p>
<p>Usually you don't need to call this. One case where it can be useful, is when the user selects the "Find" menu item while a find operation is under way. In that case, the program may want to call setActiveWindow() on that dialog. </p>
<dl class="return"><dt><b>Returns:</b></dt><dd>The find next dialog. </dd></dl>

<p>Definition at line <a class="el" href="kfind_8cpp_source.html#l00210">210</a> of file <a class="el" href="kfind_8cpp_source.html">kfind.cpp</a>.</p>

</div>
</div>
<a class="anchor" id="af66e494430aa005f66f08052ed82b0e9"></a><!-- doxytag: member="KFind::highlight" ref="af66e494430aa005f66f08052ed82b0e9" args="(const QString &amp;text, int matchingIndex, int matchedLength)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void KFind::highlight </td>
          <td>(</td>
          <td class="paramtype">const <a class="elRef" href="qstring.html">QString</a> &amp;&#160;</td>
          <td class="paramname"><em>text</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>matchingIndex</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>matchedLength</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td><code> [signal]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Connect to this signal to implement highlighting of found text during the find operation. </p>
<p>If you've set data with setData(id, text), use the signal highlight(id, matchingIndex, matchedLength)</p>
<dl class="warning"><dt><b>Warning:</b></dt><dd>If you're using the FindIncremental option, the text argument passed by this signal is not necessarily the data last set through <a class="el" href="classKFind.html#ac806c7431ccf4322b527503bc2017a38" title="Call this when needData returns true, before calling find().">setData()</a>, but can also be an earlier set data block.</dd></dl>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">text</td><td>The found text. </td></tr>
    <tr><td class="paramname">matchingIndex</td><td>The index of the found text's occurrence. </td></tr>
    <tr><td class="paramname">matchedLength</td><td>The length of the matched text. </td></tr>
  </table>
  </dd>
</dl>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classKFind.html#ac806c7431ccf4322b527503bc2017a38" title="Call this when needData returns true, before calling find().">setData()</a> </dd></dl>

</div>
</div>
<a class="anchor" id="a657f5d8ff4bfaf4fbdcb06f31ce0951b"></a><!-- doxytag: member="KFind::highlight" ref="a657f5d8ff4bfaf4fbdcb06f31ce0951b" args="(int id, int matchingIndex, int matchedLength)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void KFind::highlight </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>id</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>matchingIndex</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>matchedLength</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td><code> [signal]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Connect to this signal to implement highlighting of found text during the find operation. </p>
<p>Use this signal if you've set your data with setData(id, text), otherwise use the signal with highlight(text, matchingIndex, matchedLength).</p>
<dl class="warning"><dt><b>Warning:</b></dt><dd>If you're using the FindIncremental option, the id argument passed by this signal is not necessarily the id of the data last set through <a class="el" href="classKFind.html#ac806c7431ccf4322b527503bc2017a38" title="Call this when needData returns true, before calling find().">setData()</a>, but can also be of an earlier set data block.</dd></dl>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">id</td><td>The ID of the text fragment, as used in <a class="el" href="classKFind.html#ac806c7431ccf4322b527503bc2017a38" title="Call this when needData returns true, before calling find().">setData()</a>. </td></tr>
    <tr><td class="paramname">matchingIndex</td><td>The index of the found text's occurrence. </td></tr>
    <tr><td class="paramname">matchedLength</td><td>The length of the matched text. </td></tr>
  </table>
  </dd>
</dl>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classKFind.html#ac806c7431ccf4322b527503bc2017a38" title="Call this when needData returns true, before calling find().">setData()</a></dd></dl>
<dl class="since"><dt><b>Since:</b></dt><dd>3.3 </dd></dl>

</div>
</div>
<a class="anchor" id="a9000c1387affd5f1e95b81b6136cec3a"></a><!-- doxytag: member="KFind::index" ref="a9000c1387affd5f1e95b81b6136cec3a" args="() const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int KFind::index </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div>
<div class="memdoc">
<dl class="return"><dt><b>Returns:</b></dt><dd>the current matching index ( or -1 ). Same as the matchingIndex parameter passed to highlight. You usually don't need to use this, except maybe when updating the current data, so you need to call setData( newData, <a class="el" href="classKFind.html#a9000c1387affd5f1e95b81b6136cec3a">index()</a> ). </dd></dl>
<dl class="since"><dt><b>Since:</b></dt><dd>3.2 </dd></dl>

<p>Definition at line <a class="el" href="kfind_8cpp_source.html#l00688">688</a> of file <a class="el" href="kfind_8cpp_source.html">kfind.cpp</a>.</p>

</div>
</div>
<a class="anchor" id="ac2aa31c56ce6137e2c15672643ec0d39"></a><!-- doxytag: member="KFind::needData" ref="ac2aa31c56ce6137e2c15672643ec0d39" args="() const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool KFind::needData </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div>
<div class="memdoc">
<dl class="return"><dt><b>Returns:</b></dt><dd><code>true</code> if the application must supply a new text fragment It also means the last call returned "NoMatch". But by storing this here the application doesn't have to store it in a member variable (between calls to slotFindNext()). </dd></dl>

<p>Definition at line <a class="el" href="kfind_8cpp_source.html#l00156">156</a> of file <a class="el" href="kfind_8cpp_source.html">kfind.cpp</a>.</p>

</div>
</div>
<a class="anchor" id="a48e3acd3fc80b9209789b25269c5ece2"></a><!-- doxytag: member="KFind::numMatches" ref="a48e3acd3fc80b9209789b25269c5ece2" args="() const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int KFind::numMatches </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const<code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Return the number of matches found (i.e. </p>
<p>the number of times the highlight signal was emitted). If 0, can be used in a dialog box to tell the user "no match was found". The final dialog does so already, unless you used setDisplayFinalDialog(false). </p>
<dl class="return"><dt><b>Returns:</b></dt><dd>The number of matches. </dd></dl>

<p>Definition at line <a class="el" href="kfind_8h_source.html#l00223">223</a> of file <a class="el" href="kfind_8h_source.html">kfind.h</a>.</p>

</div>
</div>
<a class="anchor" id="a5aac4ccbdf73d8ee87c332f7e41484c2"></a><!-- doxytag: member="KFind::options" ref="a5aac4ccbdf73d8ee87c332f7e41484c2" args="() const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">long KFind::options </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const<code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Return the current options. </p>
<p>Warning: this is usually the same value as the one passed to the constructor, but options might change _during_ the replace operation: e.g. the "All" button resets the PromptOnReplace flag.</p>
<dl class="return"><dt><b>Returns:</b></dt><dd>The current options. </dd></dl>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classKFindDialog.html" title="A generic &quot;find&quot; dialog.">KFindDialog</a>. </dd></dl>

<p>Definition at line <a class="el" href="kfind_8h_source.html#l00195">195</a> of file <a class="el" href="kfind_8h_source.html">kfind.h</a>.</p>

</div>
</div>
<a class="anchor" id="a8930ac96f7c34f1c2a923f423b78ae80"></a><!-- doxytag: member="KFind::optionsChanged" ref="a8930ac96f7c34f1c2a923f423b78ae80" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void KFind::optionsChanged </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td><code> [signal]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Emitted when the options have changed. </p>
<p>This can happen e.g. with "Replace All", or if our 'find next' dialog gets a "find previous" one day. </p>

</div>
</div>
<a class="anchor" id="a56d66f34345ae798fc561ad13336a779"></a><!-- doxytag: member="KFind::pattern" ref="a56d66f34345ae798fc561ad13336a779" args="() const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="elRef" href="qstring.html">QString</a> KFind::pattern </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const<code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<dl class="return"><dt><b>Returns:</b></dt><dd>the pattern we're currently looking for </dd></dl>

<p>Definition at line <a class="el" href="kfind_8h_source.html#l00208">208</a> of file <a class="el" href="kfind_8h_source.html">kfind.h</a>.</p>

</div>
</div>
<a class="anchor" id="afb374c90fc8ee5c1f21f84d934b0df35"></a><!-- doxytag: member="KFind::resetCounts" ref="afb374c90fc8ee5c1f21f84d934b0df35" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">virtual void KFind::resetCounts </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td><code> [inline, virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Call this to reset the numMatches count (and the numReplacements count for a <a class="el" href="classKReplace.html" title="A generic implementation of the &quot;replace&quot; function.">KReplace</a>). </p>
<p>Can be useful if reusing the same <a class="el" href="classKReplace.html" title="A generic implementation of the &quot;replace&quot; function.">KReplace</a> for different operations, or when restarting from the beginning of the document. </p>

<p>Reimplemented in <a class="el" href="classKReplace.html#a9a17ef8077940fe22bc4596308e3b513">KReplace</a>.</p>

<p>Definition at line <a class="el" href="kfind_8h_source.html#l00231">231</a> of file <a class="el" href="kfind_8h_source.html">kfind.h</a>.</p>

</div>
</div>
<a class="anchor" id="ac806c7431ccf4322b527503bc2017a38"></a><!-- doxytag: member="KFind::setData" ref="ac806c7431ccf4322b527503bc2017a38" args="(const QString &amp;data, int startPos=&#45;1)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void KFind::setData </td>
          <td>(</td>
          <td class="paramtype">const <a class="elRef" href="qstring.html">QString</a> &amp;&#160;</td>
          <td class="paramname"><em>data</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>startPos</em> = <code>-1</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Call this when needData returns <code>true</code>, before calling <a class="el" href="classKFind.html#aeca9357cf928ce7bf0e63e695e13572e" title="Walk the text fragment (e.g.">find()</a>. </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">data</td><td>the text fragment (line) </td></tr>
    <tr><td class="paramname">startPos</td><td>if set, the index at which the search should start. This is only necessary for the very first call to setData usually, for the 'find in selection' feature. A value of -1 (the default value) means "process all the data", i.e. either 0 or data.length()-1 depending on FindBackwards. </td></tr>
  </table>
  </dd>
</dl>

<p>Definition at line <a class="el" href="kfind_8cpp_source.html#l00169">169</a> of file <a class="el" href="kfind_8cpp_source.html">kfind.cpp</a>.</p>

</div>
</div>
<a class="anchor" id="a00e99cbb31eb7db6ea7f9742214140ff"></a><!-- doxytag: member="KFind::setData" ref="a00e99cbb31eb7db6ea7f9742214140ff" args="(int id, const QString &amp;data, int startPos=&#45;1)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void KFind::setData </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>id</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="elRef" href="qstring.html">QString</a> &amp;&#160;</td>
          <td class="paramname"><em>data</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>startPos</em> = <code>-1</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Call this when needData returns <code>true</code>, before calling <a class="el" href="classKFind.html#aeca9357cf928ce7bf0e63e695e13572e" title="Walk the text fragment (e.g.">find()</a>. </p>
<p>The use of ID's is especially useful if you're using the FindIncremental option. </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">id</td><td>the id of the text fragment </td></tr>
    <tr><td class="paramname">data</td><td>the text fragment (line) </td></tr>
    <tr><td class="paramname">startPos</td><td>if set, the index at which the search should start. This is only necessary for the very first call to setData usually, for the 'find in selection' feature. A value of -1 (the default value) means "process all the data", i.e. either 0 or data.length()-1 depending on FindBackwards.</td></tr>
  </table>
  </dd>
</dl>
<dl class="since"><dt><b>Since:</b></dt><dd>3.3 </dd></dl>

<p>Definition at line <a class="el" href="kfind_8cpp_source.html#l00174">174</a> of file <a class="el" href="kfind_8cpp_source.html">kfind.cpp</a>.</p>

</div>
</div>
<a class="anchor" id="ab81a0a207642b5040b7f70aa7554e2a6"></a><!-- doxytag: member="KFind::setOptions" ref="ab81a0a207642b5040b7f70aa7554e2a6" args="(long options)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void KFind::setOptions </td>
          <td>(</td>
          <td class="paramtype">long&#160;</td>
          <td class="paramname"><em>options</em></td><td>)</td>
          <td><code> [virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Set new options. </p>
<p>Usually this is used for setting or clearing the FindBackwards options.</p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classKFindDialog.html" title="A generic &quot;find&quot; dialog.">KFindDialog</a>. </dd></dl>

<p>Definition at line <a class="el" href="kfind_8cpp_source.html#l00670">670</a> of file <a class="el" href="kfind_8cpp_source.html">kfind.cpp</a>.</p>

</div>
</div>
<a class="anchor" id="a6def3ea12954905ddaef3ebf39ced2b5"></a><!-- doxytag: member="KFind::setPattern" ref="a6def3ea12954905ddaef3ebf39ced2b5" args="(const QString &amp;pattern)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void KFind::setPattern </td>
          <td>(</td>
          <td class="paramtype">const <a class="elRef" href="qstring.html">QString</a> &amp;&#160;</td>
          <td class="paramname"><em>pattern</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Change the pattern we're looking for. </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">pattern</td><td>The new pattern. </td></tr>
  </table>
  </dd>
</dl>

<p>Definition at line <a class="el" href="kfind_8cpp_source.html#l00693">693</a> of file <a class="el" href="kfind_8cpp_source.html">kfind.cpp</a>.</p>

</div>
</div>
<a class="anchor" id="a0cdf16a51c2ddd48d647ef20faf4c5a8"></a><!-- doxytag: member="KFind::shouldRestart" ref="a0cdf16a51c2ddd48d647ef20faf4c5a8" args="(bool forceAsking=false, bool showNumMatches=true) const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool KFind::shouldRestart </td>
          <td>(</td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>forceAsking</em> = <code>false</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>showNumMatches</em> = <code>true</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td> const<code> [virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Returns <code>true</code> if we should restart the search from scratch. </p>
<p>Can ask the user, or return <code>false</code> (if we already searched the whole document).</p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">forceAsking</td><td>set to <code>true</code> if the user modified the document during the search. In that case it makes sense to restart the search again.</td></tr>
    <tr><td class="paramname">showNumMatches</td><td>set to <code>true</code> if the dialog should show the number of matches. Set to <code>false</code> if the application provides a "find previous" action, in which case the match count will be erroneous when hitting the end, and we could even be hitting the beginning of the document (so not all matches have even been seen).</td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd><code>true</code>, if the search should be restarted. </dd></dl>

<p>Reimplemented in <a class="el" href="classKReplace.html#a7988a0b910f65e972ef7d12c8a538f01">KReplace</a>.</p>

<p>Definition at line <a class="el" href="kfind_8cpp_source.html#l00629">629</a> of file <a class="el" href="kfind_8cpp_source.html">kfind.cpp</a>.</p>

</div>
</div>
<a class="anchor" id="a469e02f43c69769b3f4c3c815241a69d"></a><!-- doxytag: member="KFind::validateMatch" ref="a469e02f43c69769b3f4c3c815241a69d" args="(const QString &amp;text, int index, int matchedlength)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">virtual bool KFind::validateMatch </td>
          <td>(</td>
          <td class="paramtype">const <a class="elRef" href="qstring.html">QString</a> &amp;&#160;</td>
          <td class="paramname"><em>text</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>index</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>matchedlength</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td><code> [inline, virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Virtual method, which allows applications to add extra checks for validating a candidate match. </p>
<p>It's only necessary to reimplement this if the find dialog extension has been used to provide additional criterias.</p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">text</td><td>The current text fragment </td></tr>
    <tr><td class="paramname">index</td><td>The starting index where the candidate match was found </td></tr>
    <tr><td class="paramname">matchedlength</td><td>The length of the candidate match </td></tr>
  </table>
  </dd>
</dl>

<p>Definition at line <a class="el" href="kfind_8h_source.html#l00243">243</a> of file <a class="el" href="kfind_8h_source.html">kfind.h</a>.</p>

</div>
</div>
<hr/>The documentation for this class was generated from the following files:<ul>
<li><a class="el" href="kfind_8h_source.html">kfind.h</a></li>
<li><a class="el" href="kfind_8cpp_source.html">kfind.cpp</a></li>
</ul>
</div>
    </div></div>


      </td>
  </tr>
  <tr>
    <td valign="top" id="leftmenu" width="25%">
      <a name="navigation"></a>
      <div class="menu_box"><h2>kutils</h2>
<div class="nav_list">
<ul><li><a href="index.html">Main Page</a></li><li><a href="modules.html">Modules</a></li><li><a href="namespaces.html">Namespace List</a></li><li><a href="hierarchy.html">Class Hierarchy</a></li><li><a href="classes.html">Alphabetical List</a></li><li><a href="annotated.html">Class List</a></li><li><a href="files.html">File List</a></li><li><a href="functions.html">Class Members</a></li><li><a href="pages.html">Related Pages</a></li></ul>
<!--
<h2>Class Picker</h2>
<div style="text-align: center;">
<form name="guideform">
<select name="guidelinks" style="width:100%;" onChange="window.location=document.guideform.guidelinks.options[document.guideform.guidelinks.selectedIndex].value">
<option value="annotated.html">-- Choose --</option>
  <option value="classKCModuleContainer.html">kcmodulecontainer</option>,  <option value="classKCModuleInfo.html">kcmoduleinfo</option>,  <option value="classKCModuleLoader.html">kcmoduleloader</option>,  <option value="classKCModuleProxy.html">kcmoduleproxy</option>,  <option value="classKCModuleProxyIface.html">kcmoduleproxyiface</option>,  <option value="classKCModuleProxyRootDispatcher.html">kcmoduleproxyrootdispatcher</option>,  <option value="classKCMultiDialog.html">kcmultidialog</option>,  <option value="classKFind.html">kfind</option>,  <option value="classKFindDialog.html">kfinddialog</option>,  <option value="classKMultiTabBar.html">kmultitabbar</option>,  <option value="classKMultiTabBarButton.html">kmultitabbarbutton</option>,  <option value="classKMultiTabBarTab.html">kmultitabbartab</option>,  <option value="classKPluginInfo.html">kplugininfo</option>,  <option value="classKPluginSelector.html">kpluginselector</option>,  <option value="classKReplace.html">kreplace</option>,  <option value="classKReplaceDialog.html">kreplacedialog</option>,  <option value="classKSettings_1_1ComponentsDialog.html">ksettings::componentsdialog</option>,  <option value="classKSettings_1_1Dialog.html">ksettings::dialog</option>,  <option value="classKSettings_1_1Dispatcher.html">ksettings::dispatcher</option>,  <option value="classKSettings_1_1PluginPage.html">ksettings::pluginpage</option>,
</select>
</form>
</div>
-->
</div></div>
<div class="menu_box"><h2>API Dox</h2>
<div class="nav_list">
<ul>
<li><a href="../../arts/html/index.html">arts</a></li><li><a href="../../dcop/html/index.html">dcop</a></li><li><a href="../../dnssd/html/index.html">dnssd</a></li><li><a href="../../interfaces/html/index.html">interfaces</a></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<a href="../../interfaces/kimproxy/interface/html/index.html">interface</a></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<a href="../../interfaces/kimproxy/library/html/index.html">library</a></li><li>&nbsp;&nbsp;<a href="../../interfaces/kspeech/html/index.html">kspeech</a></li><li>&nbsp;&nbsp;<a href="../../interfaces/ktexteditor/html/index.html">ktexteditor</a></li><li><a href="../../kabc/html/index.html">kabc</a></li><li><a href="../../kate/html/index.html">kate</a></li><li><a href="../../kcmshell/html/index.html">kcmshell</a></li><li><a href="../../kdecore/html/index.html">kdecore</a></li><li><a href="../../kded/html/index.html">kded</a></li><li><a href="../../kdefx/html/index.html">kdefx</a></li><li><a href="../../kdeprint/html/index.html">kdeprint</a></li><li><a href="../../kdesu/html/index.html">kdesu</a></li><li><a href="../../kdeui/html/index.html">kdeui</a></li><li><a href="../../kdoctools/html/index.html">kdoctools</a></li><li><a href="../../khtml/html/index.html">khtml</a></li><li><a href="../../kimgio/html/index.html">kimgio</a></li><li><a href="../../kinit/html/index.html">kinit</a></li><li><a href="../../kio/html/index.html">kio</a></li><li>&nbsp;&nbsp;<a href="../../kio/bookmarks/html/index.html">bookmarks</a></li><li>&nbsp;&nbsp;<a href="../../kio/httpfilter/html/index.html">httpfilter</a></li><li>&nbsp;&nbsp;<a href="../../kio/kfile/html/index.html">kfile</a></li><li>&nbsp;&nbsp;<a href="../../kio/kio/html/index.html">kio</a></li><li>&nbsp;&nbsp;<a href="../../kio/kioexec/html/index.html">kioexec</a></li><li>&nbsp;&nbsp;<a href="../../kio/kpasswdserver/html/index.html">kpasswdserver</a></li><li>&nbsp;&nbsp;<a href="../../kio/kssl/html/index.html">kssl</a></li><li><a href="../../kioslave/html/index.html">kioslave</a></li><li>&nbsp;&nbsp;<a href="../../kioslave/http/html/index.html">http</a></li><li><a href="../../kjs/html/index.html">kjs</a></li><li><a href="../../kmdi/html/index.html">kmdi</a></li><li>&nbsp;&nbsp;<a href="../../kmdi/kmdi/html/index.html">kmdi</a></li><li><a href="../../knewstuff/html/index.html">knewstuff</a></li><li><a href="../../kparts/html/index.html">kparts</a></li><li><a href="../../kresources/html/index.html">kresources</a></li><li><a href="../../kspell2/html/index.html">kspell2</a></li><li><a href="../../kunittest/html/index.html">kunittest</a></li><li><a href="../../kutils/html/index.html">kutils</a></li><li><a href="../../kwallet/html/index.html">kwallet</a></li><li><a href="../../libkmid/html/index.html">libkmid</a></li><li><a href="../../libkscreensaver/html/index.html">libkscreensaver</a></li>
</ul></div></div>


        </td>
</tr>
</table>

<span class="doNotDisplay">
  <a href="http://www.kde.org/" accesskey="8">KDE Home</a> |
  <a href="http://accessibility.kde.org/" accesskey="9">KDE Accessibility Home</a> |
  <a href="http://www.kde.org/media/accesskeys.php" accesskey="0">Description of Access Keys</a>
</span>


<div style="height: 8px"></div>

<div id="footer">
  <div id="footer_left">
    Maintained by <a href="&#109;&#97;&#105;&#108;&#116;&#111;&#58;groo&#116;&#64;kde&#46;or&#x67;">Adriaan de Groot</a>
and
<a href="&#109;a&#105;&#108;&#116;&#111;&#58;w&#105;nter&#64;kde&#46;or&#x67">Allen Winter</a>.
<br/>
    KDE and K Desktop Environment are trademarks of <a href="http://www.kde.org/areas/kde-ev/" title="Homepage of the KDE non-profit Organization">KDE e.V.</a> |
    <a href="http://www.kde.org/contact/impressum.php">Legal</a>
  </div>
  <div id="footer_right"><img src="/media/images/footer_right.png" style="margin: 0px" alt="" /></div>
</div>

<!--
WARNING: DO NOT SEND MAIL TO THE FOLLOWING EMAIL ADDRESS! YOU WILL
BE BLOCKED INSTANTLY AND PERMANENTLY!
<a href="mailto:aaaatrap-425acc3b5374943f@kde.org">Block me</a>
WARNING END
-->

</body>
</html>