class KURLCompletion

# class KURLCompletion | Completion of a single URL. More...
Definition | `#include <kurlcompletion.h>`
Inherits | KCompletion (kdecore) [public ]
Inherited by | KShellCompletion
List of all Methods
Annotated List
Files
Globals
Hierarchy
Index

#### Public Types

- enum Mode { ExeCompletion=1, FileCompletion, DirCompletion }

#### Public Methods

- KURLCompletion ()
- KURLCompletion (Mode)
- virtual ~KURLCompletion ()
- virtual QString makeCompletion (const QString&)
- virtual void setDir (const QString &dir)
- virtual QString dir () const
- virtual bool isRunning () const
- virtual void stop ()
- virtual Mode mode () const
- virtual void setMode ( Mode mode )
- virtual bool replaceEnv () const
- virtual void setReplaceEnv ( bool replace )
- virtual bool replaceHome () const
- virtual void setReplaceHome ( bool replace )
- QString replacedPath ( const QString& text )

#### Public Members

- Forward MyURL
- Forward DirLister

#### Protected Methods

- void postProcessMatch ( QString *match ) const
- void postProcessMatches ( QStringList *matches ) const
- void postProcessMatches ( KCompletionMatches* matches ) const
- virtual void virtual_hook ( int id, void* data )

#### Protected Slots

- void slotEntries ( KIO::Job *, const KIO::UDSEntryList& )
- void slotIOFinished ( KIO::Job * )

## Detailed Description

This class does completion of URLs including user directories (~user) and environment variables. Remote URLs are passed to KIO.

enum Mode { ExeCompletion=1, FileCompletion, DirCompletion } | ### Mode

Determines how completion is done.

- ExeCompletion - executables in $PATH or with full path.
- FileCompletion - all files with full path or in dir(), URLs are listed using KIO.
- DirCompletion - as FileCompletion but only returns directories.

KURLCompletion () | ### KURLCompletion

Constructs a KURLCompletion object in FileCompletion mode.

KURLCompletion (Mode) | ### KURLCompletion

This overloaded constructor allows you to set the Mode to ExeCompletion or FileCompletion without using setMode. Default is FileCompletion

~KURLCompletion () | ### ~KURLCompletion

[virtual]

Destructs the KURLCompletion object.

QString makeCompletion (const QString&) | ### makeCompletion

[virtual]

Finds completions to the given text.

Remote URLs are listed with KIO. For performance reasons, local files are listed with KIO only if KURLCOMPLETION_LOCAL_KIO is set. The completion is done asyncronously if KIO is used.

Returns the first match for user, environment, and local dir completion and QString::null for asyncronous completion (KIO).

Reimplemented from KCompletion.

void setDir (const QString &dir) | ### setDir

[virtual]

Sets the current directory (used as base for completion) Default = $HOME.

QString dir () | ### dir

[const virtual]

Returns the current directory.

bool isRunning () | ### isRunning

[const virtual]

Returns true if asyncronous completion is in progress.

void stop () | ### stop

[virtual]

Stops asyncronous completion.

Mode mode () | ### mode

[const virtual]

Returns the completion mode: exe or file completion (default FileCompletion)

void setMode ( Mode mode ) | ### setMode

[virtual]

Changes the completion mode: exe or file completion

bool replaceEnv () | ### replaceEnv

[const virtual]

Returns whether environment variables are completed and whether they are replaced internally while finding completions. Default is enabled.

void setReplaceEnv ( bool replace ) | ### setReplaceEnv

[virtual]

Enables/disables completion and replacement (internally) of environment variables in URLs. Default is enabled.

bool replaceHome () | ### replaceHome

[const virtual]

Returns whether ~username is completed and whether ~username is replaced internally with the user's home directory while finding completions. Default is enabled.

void setReplaceHome ( bool replace ) | ### setReplaceHome

[virtual]

Enables/disables completion of ~username and replacement (internally) of ~username with the user's home directory. Default is enabled.

QString replacedPath ( const QString& text ) | ### replacedPath

Replaces username and/or environment variables, depending on the current settings and returns the filtered url. Only works with local files, i.e. returns back the original string for non-local urls.

void postProcessMatch ( QString *match ) | ### postProcessMatch

[protected const]

Reimplemented from KCompletion.

void postProcessMatches ( QStringList *matches ) | ### postProcessMatches

[protected const]

Reimplemented from KCompletion.

void postProcessMatches ( KCompletionMatches* matches ) | ### postProcessMatches

[protected const]

Reimplemented from KCompletion.

void slotEntries ( KIO::Job *, const KIO::UDSEntryList& ) | ### slotEntries

[protected slots slot]

void slotIOFinished ( KIO::Job * ) | ### slotIOFinished

[protected slots slot]

void virtual_hook ( int id, void* data ) | ### virtual_hook

[protected virtual]

Reimplemented from KCompletion.

- Version: $Id: kurlcompletion.h,v 1.28 2002/06/19 17:46:01 domi Exp $
- Author: David Smith
- Generated: root on macppc.ports.openbsd.org on Sat Sep 6 10:36:57 2003, using kdoc 2.0a54.