.PP
.TH "KRegExpEditorInterface" 3 "28 Jan 2004" "interfaces Library" \" -*- nroff -*-
.ad l
.nh
.SH NAME
KRegExpEditorInterface \- A graphical editor for regular expressions.  

.PP
.SH SYNOPSIS
.br
.PP
\fC#include <kregexpeditorinterface.h>\fP
.PP
.SS "Public Slots"

.in +1c
.ti -1c
.RI "virtual void \fBsetRegExp\fP (const  \fBQString\fP &regexp)=0"
.br
.RI "\fISet the regular expression for the editor. \fP"
.ti -1c
.RI "virtual void \fBredo\fP ()=0"
.br
.ti -1c
.RI "virtual void \fBundo\fP ()=0"
.br
.ti -1c
.RI "virtual void \fBsetMatchText\fP (const  \fBQString\fP &)=0"
.br
.RI "\fISet text to use when showing matches. \fP"
.ti -1c
.RI "virtual void \fBdoSomething\fP (\fBQString\fP method, void *arguments)=0"
.br
.RI "\fIThis method allows for future changes that will not break binary compatibility. \fP"
.in -1c
.SS "Signals"

.in +1c
.ti -1c
.RI "virtual void \fBcanUndo\fP (bool)=0"
.br
.RI "\fIThis signal tells whether undo is available. \fP"
.ti -1c
.RI "virtual void \fBcanRedo\fP (bool)=0"
.br
.RI "\fIThis signal tells whether redo is available. \fP"
.ti -1c
.RI "virtual void \fBchanges\fP (bool)=0"
.br
.RI "\fIThis signal is emited whenever the regular expression changes. \fP"
.in -1c
.SS "Public Member Functions"

.in +1c
.ti -1c
.RI "virtual \fBQString\fP \fBregExp\fP () const =0"
.br
.RI "\fIreturns the regular expression of the editor in Qt3 \fBQRegExp\fP syntax. \fP"
.in -1c
.SH "Detailed Description"
.PP 
A graphical editor for regular expressions. 

\fBAuthor:\fP
.RS 4
Jesper K. Pedersen blackie@kde.org
.RE
.PP
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.
.PP
To check if kregexpeditor in kdeutils is installed and available use this line:
.PP
.PP
.nf

 bool installed=!KTrader::self()->query('KRegExpEditor/KRegExpEditor').isEmpty();
 
.PP
.PP
The following is a template for what you need to do to create an instance of the regular expression dialog:
.PP
.PP
.nf

 \fBQDialog\fP *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!
.PP
.PP
.PP
.nf
   // now use the editor.
   editor->setRegExp('^kde$');
.PP
.PP
.PP
.nf
   // Finally exec the dialog
   editorDialog->exec();
 }
 else {
   // Don't offer the dialog.
 }
 
.PP
.PP
Note: signals and slots must be connected to the editorDialog object, not to the editor object: 
.PP
.nf

 connect( editorDialog, SIGNAL( \fBcanUndo( bool )\fP ), undoBut, SLOT( setEnabled( bool ) ) );
 
.PP
.PP
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:
.PP
.PP
.nf

 \fBQWidget\fP *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!
.PP
.PP
.PP
.nf
   // now use the editor.
   editor->setRegExp('^kde$');
.PP
.PP
.PP
.nf
   // Finally insert the widget into the layout of its parent
   layout->addWidget( editorWidget );
 }
 else {
   // Don't offer the editor widget.
 }
 
.PP
 
.PP
Definition at line 69 of file kregexpeditorinterface.h.
.SH "Member Function Documentation"
.PP 
.SS "virtual \fBQString\fP KRegExpEditorInterface::regExp () const\fC [pure virtual]\fP"
.PP
returns the regular expression of the editor in Qt3 \fBQRegExp\fP syntax. Note, there is also a 'regexp' \fBQt\fP property available. 
.SS "virtual void KRegExpEditorInterface::canUndo (bool)\fC [pure virtual, signal]\fP"
.PP
This signal tells whether undo is available. 
.SS "virtual void KRegExpEditorInterface::canRedo (bool)\fC [pure virtual, signal]\fP"
.PP
This signal tells whether redo is available. 
.SS "virtual void KRegExpEditorInterface::changes (bool)\fC [pure virtual, signal]\fP"
.PP
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. 
.SS "virtual void KRegExpEditorInterface::setRegExp (const \fBQString\fP & regexp)\fC [pure virtual, slot]\fP"
.PP
Set the regular expression for the editor. The syntax must be Qt3 \fBQRegExp\fP syntax. 
.SS "virtual void KRegExpEditorInterface::setMatchText (const \fBQString\fP &)\fC [pure virtual, slot]\fP"
.PP
Set text to use when showing matches. NOT IMPLEMENTED YET!
.PP
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. 
.SS "virtual void KRegExpEditorInterface::doSomething (\fBQString\fP method, void * arguments)\fC [pure virtual, slot]\fP"
.PP
This method allows for future changes that will not break binary compatibility. DONT USE!
.PP
\fBKDE\fP has a policy of keeping binary compatibility for all major version of \fBKDE\fP. This means that new methods can not be added to this API before \fBKDE\fP version 4.0.
.PP
This method is an escape door for that.
.PP
Conclusion: You should not use this method in this version of KDE! 

.SH "Author"
.PP 
Generated automatically by Doxygen for interfaces Library from the source code.
