[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-core-devel
Subject:    KCompletion
From:       Carsten Pfeiffer <carpdjih () cetus ! zrz ! TU-Berlin ! DE>
Date:       1999-12-27 12:12:31
[Download RAW message or body]

Hi,

there was some talk about completion-possibilities in KDE a while ago,
i.e. almost everything a user has to type somewhere, be it commands, urls,
filenames, email-addresses, telephone numbers, any words in an editor, ...
should be completable.

I wrote a generic class KCompletion, which makes this possible.
You have to supply completable words to it and then ask it whether some
string (the user just typed) matches something. KCompletion then returns a
completion of that string, if available.

There are three completion-modes:
 - Auto-completion as used in minicli just searches for the first matching
   item in the list of completable strings and returns the complete match.
   This happens automatically, while the user is typing

 - Manual-completion does the same, it's just not automatic, the user has
   to press a shortcut to invoke the completion.

 - Shell-completion does only return a complete match, when it is not
   ambiguous. If there is more than one matching completion, it just
   returns the longest possible string all matches begin with.
   I.e. when you have the strings kdecore and kdeui, and you would
   complete "k", shell-completion would return you "kde".

When there are multiple matches, you can rotate forwards and backwards
through them.


Now KCompletion is only the backend, so Dawit Alemayehu did a great job
writing KLineEdit and KComboBox so that they make use of KCompletion.
Using those is a very easy and consistent way to offer completion in your
application.

I have a new KURLCompletion (not only for local files like the current
ont, it's using kio for network transparency) inherited from KCompletion
since a while, but I need some time to fix/finish it.


Now if nobody objects, I'll put KCompletion into kdecore, Dawit will put
his widgets into kdeui. I think the new KURLCompletion would go into kio,
as it depends on that.

Finally, I'd like to change the CompletionMode in KGlobal: we have
CompletionAuto, CompletionMan and CompletionEOL. I'd like CompletionEOL to
become CompletionShell as EOL doesn't really say anything useful and the
EOL-shortcut is used in CompletionMan as well.

Cheers,
Carsten Pfeiffer
-- 
http://www.geocities.com/SiliconValley/1632/

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic