• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • interfaces
 

interfaces

Public Member Functions | Protected Member Functions | List of all members
KRegExpEditorInterface Class Referenceabstract

#include <kregexpeditorinterface.h>

Public Member Functions

virtual TQString regExp () const =0
 
virtual void setRegExp (const TQString &regexp)=0
 
virtual void redo ()=0
 
virtual void undo ()=0
 
virtual void setMatchText (const TQString &)=0
 
virtual void doSomething (TQString method, void *arguments)=0
 

Protected Member Functions

virtual void canUndo (bool)=0
 
virtual void canRedo (bool)=0
 
virtual void changes (bool)=0
 

Detailed Description

A graphical editor for regular expressions.

Author
Jesper K. Pedersen black.nosp@m.ie@k.nosp@m.de.or.nosp@m.g

The actual editor is located in tdeutils, with an interface in tdelibs. This means that it is a bit more complicated to create an instance of the editor, but only a little bit more complicated.

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

bool installed=!TDETrader::self()->query("KRegExpEditor/KRegExpEditor").isEmpty();

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

TQDialog *editorDialog = KParts::ComponentFactory::createInstanceFromQuery<TQDialog>( "KRegExpEditor/KRegExpEditor" );
if ( editorDialog ) {
// tdeutils was installed, so the dialog was found fetch the editor interface
KRegExpEditorInterface *editor = ::tqt_cast<KRegExpEditorInterface *>( editorDialog );
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.
}
KRegExpEditorInterface
A graphical editor for regular expressions.
Definition: kregexpeditorinterface.h:72
KRegExpEditorInterface::setRegExp
virtual void setRegExp(const TQString &regexp)=0
Set the regular expression for the editor.

Note: signals and slots must be connected to the editorDialog object, not to the editor object:

connect( editorDialog, TQ_SIGNAL( canUndo( bool ) ), undoBut, TQ_SLOT( setEnabled( bool ) ) );
KRegExpEditorInterface::canUndo
virtual void canUndo(bool)=0
This signal tells whether undo is available.

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:

TQWidget *editorWidget =
KParts::ComponentFactory::createInstanceFromQuery<TQWidget>(
"KRegExpEditor/KRegExpEditor", TQString::null, parent );
if ( editorWidget ) {
// tdeutils was installed, so the widget was found fetch the editor interface
KRegExpEditorInterface *editor = ::tqt_cast<KRegExpEditorInterface *>( editorWidget );
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.
}

Definition at line 71 of file kregexpeditorinterface.h.

Member Function Documentation

◆ canRedo()

virtual void KRegExpEditorInterface::canRedo ( bool  )
protectedpure virtual

This signal tells whether redo is available.

◆ canUndo()

virtual void KRegExpEditorInterface::canUndo ( bool  )
protectedpure virtual

This signal tells whether undo is available.

◆ changes()

virtual void KRegExpEditorInterface::changes ( bool  )
protectedpure virtual

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.

◆ doSomething()

virtual void KRegExpEditorInterface::doSomething ( TQString  method,
void *  arguments 
)
pure virtual

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

DONT USE!

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

This method is an escape door for that.

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

◆ regExp()

virtual TQString KRegExpEditorInterface::regExp ( ) const
pure virtual

returns the regular expression of the editor in Qt3 QRegExp syntax.

Note, there is also a 'regexp' Qt property available.

◆ setMatchText()

virtual void KRegExpEditorInterface::setMatchText ( const TQString &  )
pure virtual

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.

◆ setRegExp()

virtual void KRegExpEditorInterface::setRegExp ( const TQString &  regexp)
pure virtual

Set the regular expression for the editor.

The syntax must be Qt3 TQRegExp syntax.


The documentation for this class was generated from the following file:
  • kregexpeditorinterface.h

interfaces

Skip menu "interfaces"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

interfaces

Skip menu "interfaces"
  • arts
  • dcop
  • dnssd
  • interfaces
  •   kspeech
  •     interface
  •     library
  •   tdetexteditor
  • kate
  • kded
  • kdoctools
  • kimgio
  • kjs
  • libtdemid
  • libtdescreensaver
  • tdeabc
  • tdecmshell
  • tdecore
  • tdefx
  • tdehtml
  • tdeinit
  • tdeio
  •   bookmarks
  •   httpfilter
  •   kpasswdserver
  •   kssl
  •   tdefile
  •   tdeio
  •   tdeioexec
  • tdeioslave
  •   http
  • tdemdi
  •   tdemdi
  • tdenewstuff
  • tdeparts
  • tdeprint
  • tderandr
  • tderesources
  • tdespell2
  • tdesu
  • tdeui
  • tdeunittest
  • tdeutils
  • tdewallet
Generated for interfaces by doxygen 1.9.4
This website is maintained by Timothy Pearson.