summaryrefslogtreecommitdiff
path: root/libopie2/qt3
authormickeyl <mickeyl>2003-04-07 14:40:28 (UTC)
committer mickeyl <mickeyl>2003-04-07 14:40:28 (UTC)
commit75f029f87d4c84b37ccfe1c81ef205a6cd5fca79 (patch) (side-by-side diff)
tree293f6709a304aed084622e61633c945124836296 /libopie2/qt3
parent46cda1cdb4c71de6e2627a54f31d1b56cc85ee85 (diff)
downloadopie-75f029f87d4c84b37ccfe1c81ef205a6cd5fca79.zip
opie-75f029f87d4c84b37ccfe1c81ef205a6cd5fca79.tar.gz
opie-75f029f87d4c84b37ccfe1c81ef205a6cd5fca79.tar.bz2
started to document the whole stuff
Diffstat (limited to 'libopie2/qt3') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/qt3/opiecore/ocompletion.h1
1 files changed, 0 insertions, 1 deletions
diff --git a/libopie2/qt3/opiecore/ocompletion.h b/libopie2/qt3/opiecore/ocompletion.h
index 0317c1b..7f28182 100644
--- a/libopie2/qt3/opiecore/ocompletion.h
+++ b/libopie2/qt3/opiecore/ocompletion.h
@@ -105,97 +105,96 @@ public:
*
* @li shell completion works like how shells complete filenames:
* when multiple matches are available, the longest possible string of all
* matches is returned (i.e. only a partial item).
* Iterating over all matching items (complete, not partial) is possible
* via @ref nextMatch() and @ref previousMatch().
*
* You don't have to worry much about that though, OCompletion handles
* that for you, according to the setting @ref setCompletionMode().
* The default setting is globally configured by the user and read
* from @ref OGlobalSettings::completionMode().
*
* A short example:
* <pre>
* OCompletion completion;
* completion.setOrder( OCompletion::Sorted );
* completion.addItem( "pfeiffer@kde.org" );
* completion.addItem( "coolo@kde.org" );
* completion.addItem( "carpdjih@sp.zrz.tu-berlin.de" );
* completion.addItem( "carp@cs.tu-berlin.de" );
*
* cout << completion.makeCompletion( "ca" ).latin1() << endl;
* </pre>
* In shell-completion-mode, this will be "carp"; in auto-completion-
* mode it will be "carp@cs.tu-berlin.de", as that is alphabetically
* smaller.
* If setOrder was set to Insertion, "carpdjih@sp.zrz.tu-berlin.de"
* would be completed in auto-completion-mode, as that was inserted before
* "carp@cs.tu-berlin.de".
*
* You can dynamically update the completable items by removing and adding them
* whenever you want.
* For advanced usage, you could even use multiple OCompletion objects. E.g.
* imagine an editor like kwrite with multiple open files. You could store
* items of each file in a different OCompletion object, so that you know (and
* tell the user) where a completion comes from.
*
* Note: OCompletion does not work with strings that contain 0x0 characters
* (unicode nul), as this is used internally as a delimiter.
*
* You may inherit from OCompletion and override @ref makeCompletion() in
* special cases (like reading directories/urls and then supplying the
* contents to OCompletion, as OURLCompletion does), but generally, this is
* not necessary.
*
*
* @short A generic class for completing QStrings
* @author Carsten Pfeiffer <pfeiffer@kde.org>
- * @version $Id$
*/
class OCompletion : public QObject
{
Q_ENUMS( CompOrder )
Q_PROPERTY( CompOrder order READ order WRITE setOrder )
Q_PROPERTY( bool ignoreCase READ ignoreCase WRITE setIgnoreCase )
Q_PROPERTY( QStringList items READ items WRITE setItems )
Q_OBJECT
public:
/**
* Constants that represent the order in which OCompletion performs
* completion-lookups.
*/
enum CompOrder { Sorted, Insertion, Weighted };
/**
* Constructor, nothing special here :)
*/
OCompletion();
// FIXME: copy constructor, assignment constructor...
/**
* Destructor, nothing special here, either.
*/
virtual ~OCompletion();
/**
* Attempts to find an item in the list of available completions,
* that begins with @p string. Will either return the first matching item
* (if there is more than one match) or QString::null, if no match was
* found.
*
* In the latter case, a sound will be issued, depending on
* @ref isSoundsEnabled().
* If a match was found, it will also be emitted via the signal
* @ref match().
*
* If this is called twice or more often with the same string while no
* items were added or removed in the meantime, all available completions
* will be emitted via the signal @ref matches().
* This happens only in shell-completion-mode.
*
* @returns the matching item, or QString::null if there is no matching
* item.
* @see #slotMakeCompletion