\section{KReg\-Exp\-Editor\-Interface Class Reference}
\label{classKRegExpEditorInterface}\index{KRegExpEditorInterface@{KRegExpEditorInterface}}
A graphical editor for regular expressions.  


{\tt \#include $<$kregexpeditorinterface.h$>$}

\subsection*{Public Member Functions}
\begin{CompactItemize}
\item 
virtual {\bf QString} {\bf reg\-Exp} () const =0
\item 
virtual void {\bf set\-Reg\-Exp} (const {\bf QString} \&regexp)=0
\item 
virtual void {\bf redo} ()=0\label{classKRegExpEditorInterface_a2}

\item 
virtual void {\bf undo} ()=0\label{classKRegExpEditorInterface_a3}

\item 
virtual void {\bf set\-Match\-Text} (const {\bf QString} \&)=0
\item 
virtual void {\bf do\-Something} ({\bf QString} method, void $\ast$arguments)=0
\end{CompactItemize}
\subsection*{Protected Member Functions}
\begin{CompactItemize}
\item 
virtual void {\bf can\-Undo} (bool)=0
\item 
virtual void {\bf can\-Redo} (bool)=0
\item 
virtual void {\bf changes} (bool)=0
\end{CompactItemize}


\subsection{Detailed Description}
A graphical editor for regular expressions. 

\begin{Desc}
\item[Author:]Jesper K. Pedersen {\tt blackie@kde.org}\end{Desc}
The actual editor is located in kdeutils, with an interface in kdelibs. This means that it is a bit more comlicated to create an instance of the editor, but only a little bit more complicated.

To check if kregexpeditor in kdeutils is installed and available use this line:



\footnotesize\begin{verbatim} bool installed=!KTrader::self()->query("KRegExpEditor/KRegExpEditor").isEmpty();
\end{verbatim}
\normalsize


The following is a template for what you need to do to create an instance of the regular expression dialog:



\footnotesize\begin{verbatim} QDialog *editorDialog = KParts::ComponentFactory::createInstanceFromQuery<QDialog>( "KRegExpEditor/KRegExpEditor" );
 if ( editorDialog ) {
   // kdeutils was installed, so the dialog was found fetch the editor interface
   KRegExpEditorInterface *editor = static_cast<KRegExpEditorInterface *>( editorDialog->qt_cast( "KRegExpEditorInterface" ) );
   Q_ASSERT( editor ); // This should not fail!
   
   // now use the editor.
   editor->setRegExp("^kde$");

   // Finally exec the dialog
   editorDialog->exec();
 }
 else {
   // Don't offer the dialog.
 }
\end{verbatim}
\normalsize


Note: signals and slots must be connected to the editor\-Dialog object, not to the editor object: 

\footnotesize\begin{verbatim} connect( editorDialog, SIGNAL( canUndo( bool ) ), undoBut, SLOT( setEnabled( bool ) ) );
\end{verbatim}
\normalsize


If you want to create an instance of the editor widget, i.e. not the dialog, then you must do it in the following way:



\footnotesize\begin{verbatim} QWidget *editorWidget =
 KParts::ComponentFactory::createInstanceFromQuery<QWidget>( 
     "KRegExpEditor/KRegExpEditor", QString::null, parent );
 if ( editorWidget ) {
   // kdeutils was installed, so the widget was found fetch the editor interface
   KRegExpEditorInterface *editor = static_cast<KRegExpEditorInterface *>( editorWidget->qt_cast( "KRegExpEditorInterface" ) );
   Q_ASSERT( editor ); // This should not fail!
   
   // now use the editor.
   editor->setRegExp("^kde$");

   // Finally insert the widget into the layout of its parent
   layout->addWidget( editorWidget );
 }
 else {
   // Don't offer the editor widget.
 }
\end{verbatim}
\normalsize
 



Definition at line 71 of file kregexpeditorinterface.h.

\subsection{Member Function Documentation}
\index{KRegExpEditorInterface@{KReg\-Exp\-Editor\-Interface}!regExp@{regExp}}
\index{regExp@{regExp}!KRegExpEditorInterface@{KReg\-Exp\-Editor\-Interface}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}virtual {\bf QString} KReg\-Exp\-Editor\-Interface::reg\-Exp () const\hspace{0.3cm}{\tt  [pure virtual]}}\label{classKRegExpEditorInterface_a0}


returns the regular expression of the editor in Qt3 {\bf QReg\-Exp} syntax. 

Note, there is also a 'regexp' {\bf Qt} property available. \index{KRegExpEditorInterface@{KReg\-Exp\-Editor\-Interface}!canUndo@{canUndo}}
\index{canUndo@{canUndo}!KRegExpEditorInterface@{KReg\-Exp\-Editor\-Interface}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}virtual void KReg\-Exp\-Editor\-Interface::can\-Undo (bool)\hspace{0.3cm}{\tt  [protected, pure virtual]}}\label{classKRegExpEditorInterface_b0}


This signal tells whether undo is available. 

\index{KRegExpEditorInterface@{KReg\-Exp\-Editor\-Interface}!canRedo@{canRedo}}
\index{canRedo@{canRedo}!KRegExpEditorInterface@{KReg\-Exp\-Editor\-Interface}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}virtual void KReg\-Exp\-Editor\-Interface::can\-Redo (bool)\hspace{0.3cm}{\tt  [protected, pure virtual]}}\label{classKRegExpEditorInterface_b1}


This signal tells whether redo is available. 

\index{KRegExpEditorInterface@{KReg\-Exp\-Editor\-Interface}!changes@{changes}}
\index{changes@{changes}!KRegExpEditorInterface@{KReg\-Exp\-Editor\-Interface}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}virtual void KReg\-Exp\-Editor\-Interface::changes (bool)\hspace{0.3cm}{\tt  [protected, pure virtual]}}\label{classKRegExpEditorInterface_b2}


This signal is emited whenever the regular expression changes. 

The argument is true when the regular expression is different from the loaded regular expression and false when it is equal to the loaded regular expression. \index{KRegExpEditorInterface@{KReg\-Exp\-Editor\-Interface}!setRegExp@{setRegExp}}
\index{setRegExp@{setRegExp}!KRegExpEditorInterface@{KReg\-Exp\-Editor\-Interface}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}virtual void KReg\-Exp\-Editor\-Interface::set\-Reg\-Exp (const {\bf QString} \& {\em regexp})\hspace{0.3cm}{\tt  [pure virtual]}}\label{classKRegExpEditorInterface_a1}


Set the regular expression for the editor. 

The syntax must be Qt3 {\bf QReg\-Exp} syntax. \index{KRegExpEditorInterface@{KReg\-Exp\-Editor\-Interface}!setMatchText@{setMatchText}}
\index{setMatchText@{setMatchText}!KRegExpEditorInterface@{KReg\-Exp\-Editor\-Interface}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}virtual void KReg\-Exp\-Editor\-Interface::set\-Match\-Text (const {\bf QString} \&)\hspace{0.3cm}{\tt  [pure virtual]}}\label{classKRegExpEditorInterface_a4}


Set text to use when showing matches. 

NOT IMPLEMENTED YET!

This method is not yet implemented. In later version of the widget this method will be used to give the widget a text to show matches of the regular expression on. \index{KRegExpEditorInterface@{KReg\-Exp\-Editor\-Interface}!doSomething@{doSomething}}
\index{doSomething@{doSomething}!KRegExpEditorInterface@{KReg\-Exp\-Editor\-Interface}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}virtual void KReg\-Exp\-Editor\-Interface::do\-Something ({\bf QString} {\em method}, void $\ast$ {\em arguments})\hspace{0.3cm}{\tt  [pure virtual]}}\label{classKRegExpEditorInterface_a5}


This method allows for future changes that will not break binary compatibility. 

DONT USE!

{\bf KDE} has a policy of keeping binary compatibility for all major version of {\bf KDE}. This means that new methods can not be added to this API before {\bf KDE} version 4.0.

This method is an escape door for that.

Conclusion: You should not use this method in this version of KDE! 

The documentation for this class was generated from the following file:\begin{CompactItemize}
\item 
kregexpeditorinterface.h\end{CompactItemize}
