.TH "KRegExpEditorInterface" kde3 "11 Jun 2005" "Version Version 3.4.1" "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 Member Functions"

.in +1c
.ti -1c
.RI "virtual \fBQString\fP \fBregExp\fP () const =0"
.br
.ti -1c
.RI "virtual void \fBsetRegExp\fP (const \fBQString\fP &regexp)=0"
.br
.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
.ti -1c
.RI "virtual void \fBdoSomething\fP (\fBQString\fP method, void *arguments)=0"
.br
.in -1c
.SS "Protected Member Functions"

.in +1c
.ti -1c
.RI "virtual void \fBcanUndo\fP (bool)=0"
.br
.ti -1c
.RI "virtual void \fBcanRedo\fP (bool)=0"
.br
.ti -1c
.RI "virtual void \fBchanges\fP (bool)=0"
.br
.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();
.fi
.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
 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.
 }
.fi
.PP
.PP
Note: signals and slots must be connected to the editorDialog object, not to the editor object: 
.PP
.nf
 connect( editorDialog, SIGNAL( canUndo( bool ) ), undoBut, SLOT( setEnabled( bool ) ) );

.fi
.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
 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.
 }
.fi
.PP
 
.PP
Definition at line 71 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. 
.PP
Note, there is also a 'regexp' \fBQt\fP property available. 
.SS "virtual void KRegExpEditorInterface::canUndo (bool)\fC [protected, pure virtual]\fP"
.PP
This signal tells whether undo is available. 
.PP
.SS "virtual void KRegExpEditorInterface::canRedo (bool)\fC [protected, pure virtual]\fP"
.PP
This signal tells whether redo is available. 
.PP
.SS "virtual void KRegExpEditorInterface::changes (bool)\fC [protected, pure virtual]\fP"
.PP
This signal is emited whenever the regular expression changes. 
.PP
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]\fP"
.PP
Set the regular expression for the editor. 
.PP
The syntax must be Qt3 \fBQRegExp\fP syntax. 
.SS "virtual void KRegExpEditorInterface::setMatchText (const \fBQString\fP &)\fC [pure virtual]\fP"
.PP
Set text to use when showing matches. 
.PP
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]\fP"
.PP
This method allows for future changes that will not break binary compatibility. 
.PP
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.
