Public Members
- KEdit (KApplication *a=NULL,QWidget *parent=NULL, const char *name=NULL, const char *filename=NULL)
- ~KEdit ()
- enum {NONE, FORWARD, BACKWARD }
- enum {KEDIT_OK = 0, KEDIT_OS_ERROR = 1, KEDIT_USER_CANCEL = 2 , KEDIT_RETRY = 3, KEDIT_NOPERMISSIONS = 4}
- enum {OPEN_READWRITE = 1, OPEN_READONLY = 2, OPEN_INSERT = 4 }
- int newFile ()
- int doSave ()
- int doSave ( const char *filename )
- int saveAs ()
- int openFile ( int mode )
- int insertFile ()
- int loadFile ( QString filename , int mode )
- QString getName ()
- void setName ( const char *_name )
- QString markedText ()
- void selectFont ()
- void Search ()
- int repeatSearch ()
- void Replace ()
- void doGotoLine ()
- bool isModified ()
- void toggleModified ( bool )
- void setAutoIndentMode ( bool )
- bool AutoIndentMode ()
- void installRBPopup ( QPopupMenu* )
- int currentLine ()
- int currentColumn ()
- bool WordWrap ()
- void setWordWrap (bool )
- bool FillColumnMode ()
- void setFillColumnMode (int line, bool set)
- void saveBackupCopy (bool copy)
- void setFileName (char* name)
- void saveasfile (char* name)
- void setReduceWhiteOnJustify (bool reduce)
- bool format (QStrList& )
- bool format2 (QStrList& par, int& upperbound)
- void getpar (int line,QStrList& par)
- void getpar2 (int line,QStrList& par,int& upperbound,QString &prefix)
Public Slots
- void setModified ()
- void search_slot ()
- void searchdone_slot ()
- void replace_slot ()
- void replace_all_slot ()
- void replace_search_slot ()
- void replacedone_slot ()
- void computePosition ()
- void repaintAll ()
Protected Members
- QTimer* repaintTimer
- int saveFile ()
- int doSearch (QString s_pattern, bool case_sensitive, bool regex, bool forward,int line, int col)
- int doReplace (QString s_pattern, bool case_sensitive, bool regex, bool forward,int line, int col,bool replace)
- QFileDialog* getFileDialog (const char* captiontext)
- bool eventFilter ( QObject *, QEvent * )
- void keyPressEvent ( QKeyEvent * )
- void mousePressEvent ( QMouseEvent* )
- void mouseReleaseEvent ( QMouseEvent* )
- void mouseMoveEvent ( QMouseEvent* )
Signals
Opens a new untitled document in the text widget The user is given
a chance to save the current document if the current document has
been modified.
Saves the file if necessary under the current file name. If the current file
name is Untitled, as it is after a call to newFile(), this routing will
call saveAs().
int doSave ( const char *filename )
|
Saves the file as filename
Allows the user to save the file under a new name
int openFile ( int mode )
|
This will present an open file dialog and open the file specified by the user,
if possible. The return codes are KEDIT_OK, KEDIT_USER_CANCEL and
KEDIT_OS_ERROR. The user will be given a chance to save the current file if
it has been modified. mode is one of OPEN_READONLY, OPEN_READWRITE.
OPEN_READONLY means that the user will not be able to insert characters
into the document.
Calling this method will let the user insert a file at the current cursor
position. Return codes are KEDIT_OK, KEDIT_USER_CANCEL, KDEDIT_OS_ERROR.
int loadFile ( QString filename , int mode )
|
Loads the file filename into editor. The possible modes are
OPEN_READONLY, OPEN_READWRITE, OPEN_INSERT.
OPEN_READONLY means that the user will not be able to insert characters
into the document. OPEN_INSERT means that the file will be inserted
into the current document at the current cursor position.
Returns the filename of the currnet file. You can use setName() to set the
filename of the current file
void setName ( const char *_name )
|
Sets the filename of the currnet file. You can use getName() to set the
filename of the current file
Returns the currently marked text.
Lets the user select a font and sets the font of the textwidget to that
selected font.
Presents a search dialog to the user
Repeasts the last search specified on the search dialog. If the user
hasn't searched for anything until now, this method will simply return
without doing anything.
Presents a Search and Replace Dialog to the User.
Presents a "Goto Line" dialog to the User
Returns true if the document has been modified.
void toggleModified ( bool )
|
Toggles the modification status of the document. TRUE = Modified,
FALSE = UNMODIFIED. Methods such as doSave() rely on this to see whether
the document needs to be saved.
void setAutoIndentMode ( bool )
|
Sets the Indent Mode. TRUE = Indent mode on, FALSE = Indent mode off.
Returns the Indent Mode. TRUE = Indent mode on, FALSE = Indent mode off.
Install a Popup Menue for KEdit. The Popup Menu will be activated on
a right mouse button press event.
Returns the current line number, that is the line the cursor is on.
This returns the actual column number the cursor is on. This call differs
from QMultiLineEdit::getCursorPosition in that it returns the actual cursor
position and not the character position. Use currentLine() and currentColumn()
if you want to display the current line or column in the status bar for
example.
Returns TRUE if word wrap is on. You also need to specify the fill column
with setFillColumnMode() otherwise wordwrap is not in effect.
You also need to specify the fill column
with setFillColumnMode() otherwise wordwrap is not in effect.
Returns TRUE if fill column mode is on, that is if the line will
be broken automatically when if a character is to be inserted past
this position.
void setFillColumnMode (int line, bool set)
|
Set the fill column to column col, if col is strictly larger than 0.
If col is 0, fill column mode is turned off.
In fill column mode, the line will
be broken automatically at column col, when a character is
inserted past column col..
void saveBackupCopy (bool copy)
|
If copy is TRUE KEdit will make a backup copy of the document that
is being edited on opening it. The backup copy will receive the
suffix ~. The default is TRUE.
void setFileName (char* name)
|
Sets the name of the file if a file is open.
void saveasfile (char* name)
|
saves the current file as 'name'
void setReduceWhiteOnJustify (bool reduce)
|
remove tabs and whitespace on the end of lines during a justify operation
[signal] This signal is emitted when the document in the textwidget has changed
void CursorPositionChanged ()
|
[signal] This signal is emitted whenever the cursor position changed.
Use this in conjunction with currentLine(), currentColumn()
if you need to know the cursor position.
[signal] This signal is emitted just before saving a file. Since KEdit calls
kapp->processEvents(), you have a chance to let the user know what's
going to happen.
[signal] This signal is emitted just before loading a file. Since KEdit calls
kapp->processEvents(), you have a chance to let the user know what's
going to happen.
void toggle_overwrite_signal ()
|
[signal] This signal is emitted if the user toggles from overwrite to insert mode.
He can do so by pressing the "Insert" Button on a PC keyboard.
Generated by: root@porky.devel.redhat.com on Fri Sep 24 17:45:05 199. |