Main Page   Modules   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   Related Pages  

KURLCompletion Class Reference

Completion of a single URL. More...

#include <kurlcompletion.h>

Inheritance diagram for KURLCompletion:

KCompletion KShellCompletion List of all members.

Public Types

enum  Mode

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)

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)

Detailed Description

Completion of a single URL.

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

Author:
David Smith <dsmith@algonet.se>
Version:
Id:
kurlcompletion.h,v 1.28 2002/06/19 17:46:01 domi Exp

Definition at line 42 of file kurlcompletion.h.


Member Enumeration Documentation

enum KURLCompletion::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.

Definition at line 54 of file kurlcompletion.h.


Constructor & Destructor Documentation

KURLCompletion::KURLCompletion  
 

Constructs a KURLCompletion object in FileCompletion mode.

KURLCompletion::KURLCompletion Mode   
 

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

virtual KURLCompletion::~KURLCompletion   [virtual]
 

Destructs the KURLCompletion object.


Member Function Documentation

virtual QString KURLCompletion::dir   [virtual]
 

Returns the current directory.

virtual bool KURLCompletion::isRunning   [virtual]
 

Returns true if asyncronous completion is in progress.

virtual QString KURLCompletion::makeCompletion const QString &    [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.

Reimplemented in KShellCompletion.

virtual Mode KURLCompletion::mode   [virtual]
 

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

void KURLCompletion::postProcessMatch QString *    match const [protected, virtual]
 

This method is called after a completion is found and before the matching string is emitted. You can override this method to modify the string that will be emitted. This is necessary e.g. in KURLCompletion(), where files with spaces in their names are shown escaped ("filename\ with\ spaces"), but stored unescaped inside KCompletion. Never delete that pointer!

Default implementation does nothing.

Parameters:
match  the match to process
See also:
postProcessMatches

Reimplemented from KCompletion.

Reimplemented in KShellCompletion.

void KURLCompletion::postProcessMatches KCompletionMatches   matches const [protected, virtual]
 

This method is called before a list of all available completions is emitted via matches. You can override this method to modify the found items before match() or matches() are emitted. Never delete that pointer!

Default implementation does nothing.

Parameters:
matches  the matches to process
See also:
postProcessMatch

Reimplemented from KCompletion.

Reimplemented in KShellCompletion.

void KURLCompletion::postProcessMatches QStringList *    matches const [protected, virtual]
 

This method is called before a list of all available completions is emitted via matches. You can override this method to modify the found items before match() or matches are emitted. Never delete that pointer!

Default implementation does nothing.

Parameters:
matches  the matches to process
See also:
postProcessMatch

Reimplemented from KCompletion.

Reimplemented in KShellCompletion.

QString KURLCompletion::replacedPath const QString &    text
 

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.

virtual bool KURLCompletion::replaceEnv   [virtual]
 

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

virtual bool KURLCompletion::replaceHome   [virtual]
 

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

virtual void KURLCompletion::setDir const QString &    dir [virtual]
 

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

virtual void KURLCompletion::setMode Mode    mode [virtual]
 

Changes the completion mode: exe or file completion

virtual void KURLCompletion::setReplaceEnv bool    replace [virtual]
 

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

virtual void KURLCompletion::setReplaceHome bool    replace [virtual]
 

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

virtual void KURLCompletion::stop   [virtual]
 

Stops asyncronous completion.


The documentation for this class was generated from the following file:
Generated on Wed Aug 13 23:30:28 2003 for kdelibs by doxygen1.2.18