KTextEditor

Christoph Cullmann crossfire at babylon2k.de
Mon Oct 7 22:19:08 BST 2002


Here my quick response ;)

First some stuff about the current state of KTextEditor:
1. it HAS all needed basic TEXT editing stuff allready inside
2. it is highly extensible, perhaps one of the most extensible / modular 
interfaces in kde libs atm
3. At least kate part + kvim part supports a subset of the available 
interfaces

Now some infos about what would be need to do to let you be able to handle 
richtext:

Simply add a new richtextinterface to the ktexteditor interfaces set (with 
your given needed methodes:
void setGlobalFont( const QFont& );
void setFont( const QFont&, uint start, uint end );
void setColor( const QColor&, uint start, uint end );
QString exportToHTML() const;
QString exportToText() const;

and a spellcheck thingy like you mentioned it

(or some more, that's your buisness)

What will that win ?
- not yet an other interface (as the current one is allready in use by 
kdevelop and indirect in quanta + kate + kvim part + kate part + kwrite + 
some others)
- the user can than chose between kword part (if it implements ktexteditor), 
kate, kvim, .... (you only must check which interfaces the part support with 
the given methodes in the ktexteditor interfaces, which use qt_cast, ...., 
and disable/enable the actions in kmail you want)

Now where is the problem to use ktexteditor at all ? About the default editing 
component: that can be chosen system wide and/or app wide, and kmail could 
make it's defaults clear (for example; kword best , than kvim, than kate or 
the other way around ;)

What does ktexteditor need:
only a editor part seperated in document/view, where the doc is a kpart + the 
view is a QWidget, even kvim has made that possible.

About my plan for kate part:
Can only say the same a jowenn: kate part should stay what it is: a plain 
texteditor which concentrates on handling large text well and be no kword 
clone, or we could simply put kword in kdelibs. Perhaps in the far future 
kate part will get some richtext stuff, too, but only in a limited fashion. 
(as the main stuff atm is: speed, stability, word wrap, folding, 
highlighting, and, later: bidi)

Therefor my final thoughts:
Use KTextEditor, add your wanted interfaces to it after 3.1 and be happy. Let 
the user decide if he really wants richtext editing or not. (coolo: don'T 
really think that is the basic what kmail needs, too ;)))

cu
Christoph

-- 
Christoph "Crossfire" Cullmann
Kate/KDE developer
cullmann at kde.org
http://kate.kde.org




More information about the kde-core-devel mailing list