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

KIO Namespace Reference

A namespace for KIO globals. More...


Compounds

class  AuthInfo
 A two way messaging class for passing authentication information. More...

class  ChmodJob
class  Connection
struct  CopyInfo
class  CopyJob
class  DavJob
class  DefaultProgress
class  DeleteJob
class  FileCopyJob
class  ListJob
class  MetaInfoJob
class  MimetypeJob
struct  GetRequest
class  Job
class  MetaData
class  MultiGetJob
class  NetAccess
 Provides a synchronous interface to io jobs. More...

struct  AutoLogin
class  NetRC
 An interface to kionetrc and the ftp .netrc files. More...

class  ParseContext
class  ParseTreeAND
class  ParseTreeBase
class  ParseTreeBOOL
class  ParseTreeBRACKETS
class  ParseTreeCALC
class  ParseTreeCMP
class  ParseTreeDOUBLE
class  ParseTreeEXIST
class  ParseTreeID
class  ParseTreeIN
class  ParseTreeMATCH
class  ParseTreeMAX2
class  ParseTreeMIN2
class  ParseTreeNOT
class  ParseTreeNUM
class  ParseTreeOR
class  ParseTreeSTRING
class  PasswordDialog
struct  PreferencesMaxima
struct  PreferencesReturn
class  PreviewJob
class  ProgressBase
 Base class for IO progress dialogs. More...

class  RenameDlg
class  Scheduler
class  SessionData
class  SimpleJob
class  SkipDlg
class  Slave
class  SlaveBase
class  SlaveConfig
class  SlaveInterface
class  StatJob
class  StatusbarProgress
 IO progress widget for embedding in a statusbar. More...

struct  Task
class  TCPSlaveBase
class  TransferJob
class  UDSAtom

Typedefs

typedef QValueList< UDSAtom > UDSEntry

Enumerations

enum  Error
enum  UDSAtomTypes {
  UDS_STRING = 1 , UDS_SIZE = 8 | UDS_LONG , UDS_USER = 16 | UDS_STRING, UDS_GROUP = 32 | UDS_STRING,
  UDS_NAME = 64 | UDS_STRING, UDS_ACCESS = 128 | UDS_LONG, UDS_MODIFICATION_TIME = 256 | UDS_TIME, UDS_ACCESS_TIME = 512 | UDS_TIME,
  UDS_CREATION_TIME = 1024 | UDS_TIME, UDS_FILE_TYPE = 2048 | UDS_LONG, UDS_LINK_DEST = 4096 | UDS_STRING, UDS_URL = 8192 | UDS_STRING,
  UDS_MIME_TYPE = 16384 | UDS_STRING, UDS_GUESSED_MIME_TYPE = 16392 | UDS_STRING, UDS_XML_PROPERTIES = 32768 | UDS_STRING
}
enum  CacheControl {
  CC_CacheOnly, CC_Cache, CC_Verify, CC_Refresh,
  CC_Reload
}
enum  Command
enum  Info
enum  Message
enum  HTTP_METHOD

Functions

ChmodJobchmod (const KFileItemList &lstItems, int permissions, int mask, QString newOwner, QString newGroup, bool recursive, bool showProgressInfo=true)
QString convertSize (KIO::filesize_t size)
QString number (KIO::filesize_t size)
QString convertSizeFromKB (KIO::filesize_t kbSize)
QTime calculateRemaining (KIO::filesize_t totalSize, KIO::filesize_t processedSize, KIO::filesize_t speed)
QString itemsSummaryString (uint items, uint files, uint dirs, KIO::filesize_t size, bool showSize)
QString encodeFileName (const QString &str)
QString decodeFileName (const QString &str)
QString findDeviceMountPoint (const QString &device)
QString findPathMountPoint (const QString &filename)
bool probably_slow_mounted (const QString &filename)
bool manually_mounted (const QString &filename)
SimpleJobmkdir (const KURL &url, int permissions=-1)
SimpleJobrmdir (const KURL &url)
SimpleJobchmod (const KURL &url, int permissions)
SimpleJobrename (const KURL &src, const KURL &dest, bool overwrite)
SimpleJobsymlink (const QString &target, const KURL &dest, bool overwrite, bool showProgressInfo=true)
SimpleJobspecial (const KURL &url, const QByteArray &data, bool showProgressInfo=true)
SimpleJobmount (bool ro, const char *fstype, const QString &dev, const QString &point, bool showProgressInfo=true)
SimpleJobunmount (const QString &point, bool showProgressInfo=true)
SimpleJobhttp_update_cache (const KURL &url, bool no_cache, time_t expireDate)
StatJob * stat (const KURL &url, bool showProgressInfo=true)
StatJob * stat (const KURL &url, bool sideIsSource, short int details, bool showProgressInfo=true)
TransferJobget (const KURL &url, bool reload=false, bool showProgressInfo=true)
TransferJobput (const KURL &url, int permissions, bool overwrite, bool resume, bool showProgressInfo=true)
TransferJobhttp_post (const KURL &url, const QByteArray &postData, bool showProgressInfo=true)
MimetypeJob * mimetype (const KURL &url, bool showProgressInfo=true)
FileCopyJobfile_copy (const KURL &src, const KURL &dest, int permissions=-1, bool overwrite=false, bool resume=false, bool showProgressInfo=true)
FileCopyJobfile_move (const KURL &src, const KURL &dest, int permissions=-1, bool overwrite=false, bool resume=false, bool showProgressInfo=true)
SimpleJobfile_delete (const KURL &src, bool showProgressInfo=true)
ListJob * listDir (const KURL &url, bool showProgressInfo=true, bool includeHidden=true)
ListJob * listRecursive (const KURL &url, bool showProgressInfo=true, bool includeHidden=true)
CopyJob * copy (const KURL &src, const KURL &dest, bool showProgressInfo=true)
CopyJob * copyAs (const KURL &src, const KURL &dest, bool showProgressInfo=true)
CopyJob * copy (const KURL::List &src, const KURL &dest, bool showProgressInfo=true)
CopyJob * move (const KURL &src, const KURL &dest, bool showProgressInfo=true)
CopyJob * moveAs (const KURL &src, const KURL &dest, bool showProgressInfo=true)
CopyJob * move (const KURL::List &src, const KURL &dest, bool showProgressInfo=true)
CopyJob * link (const KURL &src, const KURL &destDir, bool showProgressInfo=true)
CopyJob * link (const KURL::List &src, const KURL &destDir, bool showProgressInfo=true)
CopyJob * linkAs (const KURL &src, const KURL &dest, bool showProgressInfo=true)
DeleteJobdel (const KURL &src, bool shred=false, bool showProgressInfo=true)
int matchConstraint (const ParseTreeBase *_tree, const KService::Ptr &, const KServiceTypeProfile::OfferList &)
PreferencesReturn matchPreferences (const ParseTreeBase *_tree, const KService::Ptr &, const KServiceTypeProfile::OfferList &)
MetaInfoJobfileMetaInfo (const KFileItemList &items)
MetaInfoJobfileMetaInfo (const KURL::List &items)
PreviewJobfilePreview (const KFileItemList &items, int width, int height=0, int iconSize=0, int iconAlpha=70, bool scale=true, bool save=true, const QStringList *enabledPlugins=0)
PreviewJobfilePreview (const KURL::List &items, int width, int height=0, int iconSize=0, int iconAlpha=70, bool scale=true, bool save=true, const QStringList *enabledPlugins=0)


Detailed Description

A namespace for KIO globals.

Typedef Documentation

typedef QValueList<UDSAtom> KIO::UDSEntry
 

An entry is the list of atoms containing all the informations for a file or URL

Definition at line 324 of file kio/kio/global.h.


Enumeration Type Documentation

enum KIO::CacheControl
 

Enumeration values:
CC_CacheOnly  Fail request if not in cache.
CC_Cache  Use cached entry if available.
CC_Verify  Validate cached entry with remote site if expired.
CC_Refresh  Always validate cached entry with remote site
Since:
3.1
CC_Reload  Always fetch from remote site.

Definition at line 249 of file kio/kio/global.h.

enum KIO::Command
 

Commands that can be invoked by a job.

Definition at line 43 of file slaveinterface.h.

enum KIO::Error
 

Error codes that can be emitted by KIO.

Definition at line 97 of file kio/kio/global.h.

enum KIO::HTTP_METHOD
 

HTTP / DAV method *

Definition at line 27 of file http.h.

enum KIO::Info
 

Identifiers for KIO informational messages.

Definition at line 79 of file slaveinterface.h.

enum KIO::Message
 

Identifiers for KIO data messages.

Definition at line 99 of file slaveinterface.h.

enum KIO::UDSAtomTypes
 

Constants used to specify the type of a KUDSAtom.

Enumeration values:
UDS_STRING  First let's define the item types.
UDS_SIZE  Size of the file.
UDS_USER  User ID of the file owner.
UDS_GROUP  Group ID of the file owner.
UDS_NAME  Filename.
UDS_ACCESS  Access permissions (part of the mode returned by stat).
UDS_MODIFICATION_TIME  The last time the file was modified.
UDS_ACCESS_TIME  The last time the file was opened.
UDS_CREATION_TIME  The time the file was created.
UDS_FILE_TYPE  File type, part of the mode returned by stat (for a link, this returns the file type of the pointed item) check UDS_LINK_DEST to know if this is a link
UDS_LINK_DEST  Name of the file where the link points to Allows to check for a symlink (don't use S_ISLNK !)
UDS_URL  An alternative URL (If different from the caption).
UDS_MIME_TYPE  A mime type; prevents guessing.
UDS_GUESSED_MIME_TYPE  A mime type to be used for displaying only. But when 'running' the file, the mimetype is re-determined
UDS_XML_PROPERTIES  XML properties, e.g. for WebDAV
Since:
3.1

Definition at line 207 of file kio/kio/global.h.


Function Documentation

QTime calculateRemaining KIO::filesize_t    totalSize,
KIO::filesize_t    processedSize,
KIO::filesize_t    speed
 

Calculates remaining time from total size, processed size and speed.

Parameters:
totalSize  total size in bytes
processedSize  processed size in bytes
speed  speed in bytes pre second
Returns:
calculated remaining time

SimpleJob* chmod const KURL   url,
int    permissions
 

Changes permissions on a file or directory. See the other chmod below for changing many files or directories.

Parameters:
url  The URL of file or directory.
permissions  The permissions to set.
Returns:
The job handling the operation.

ChmodJob* chmod const KFileItemList &    lstItems,
int    permissions,
int    mask,
QString    newOwner,
QString    newGroup,
bool    recursive,
bool    showProgressInfo = true
 

Creates a job that changes permissions/ownership on several files or directories, optionally recursively. This version of chmod uses a KFileItemList so that it directly knows what to do with the items. TODO: a version that takes a KURL::List, and a general job that stats each url and returns a KFileItemList.

Note that change of ownership is only supported for local files.

Inside directories, the "x" bits will only be changed for files that had at least one "x" bit before, and for directories. This emulates the behaviour of chmod +X.

Parameters:
lstItems  The file items representing several files or directories.
permissions  the permissions we want to set
mask  the bits we are allowed to change For instance, if mask is 0077, we don't change the "user" bits, only "group" and "others".
newOwner  If non-empty, the new owner for the files
newGroup  If non-empty, the new group for the files
recursive  whether to open directories recursively
Returns:
The job handling the operation.

QString convertSize KIO::filesize_t    size
 

Converts size from bytes to the string representation.

Parameters:
size  size in bytes
Returns:
converted size as a string - e.g. 123.4 kB , 12.0 MB

QString convertSizeFromKB KIO::filesize_t    kbSize
 

Converts size from kilo-bytes to the string representation.

Parameters:
size  size in kilo-bytes
Returns:
converted size as a string - e.g. 123.4 kB , 12.0 MB

CopyJob* copy const KURL::List   src,
const KURL   dest,
bool    showProgressInfo = true
 

Copy a list of file/dirs src into a destination directory dest.

CopyJob* copy const KURL   src,
const KURL   dest,
bool    showProgressInfo = true
 

Copy a file or directory src into the destination @dest, which can be a file (including the final filename) or a directory (into which src will be copied).

This emulates the cp command completely.

CopyJob* copyAs const KURL   src,
const KURL   dest,
bool    showProgressInfo = true
 

Copy a file or directory src into the destination @dest, which is the destination name in any case, even for a directory.

As opposed to copy, this doesn't emulate cp, but is the only way to copy a directory, giving it a new name and getting an error box if a directory already exists with the same name.

QString decodeFileName const QString &    str
 

Decodes (from the filename to the text displayed) This translates %2[fF] into / and %% into %

DeleteJob* del const KURL   src,
bool    shred = false,
bool    showProgressInfo = true
 

Delete a file or directory.

Parameters:
src  file to delete
shred  If true, delete in a way that makes recovery impossible (only supported for local files currently)

QString encodeFileName const QString &    str
 

Encodes (from the text displayed to the real filename) This translates % into %% and / into %2f Used by KIO::link, for instance.

FileCopyJob* file_copy const KURL   src,
const KURL   dest,
int    permissions = -1,
bool    overwrite = false,
bool    resume = false,
bool    showProgressInfo = true
 

Copy a single file.

Uses either SlaveBase::copy() if the slave supports that or get() and put() otherwise.

Parameters:
src  Where to get the file.
dest  Where to put the file.
permissions  May be -1. In this case no special permission mode is set.
overwrite  If true, any existing file will be overwritten.
resume 

SimpleJob* file_delete const KURL   src,
bool    showProgressInfo = true
 

Delete a single file.

Parameters:
src  File to delete.

FileCopyJob* file_move const KURL   src,
const KURL   dest,
int    permissions = -1,
bool    overwrite = false,
bool    resume = false,
bool    showProgressInfo = true
 

Move a single file.

Use either SlaveBase::rename() if the slave supports that, or copy() and del() otherwise, or eventually get() & put() & del()

Parameters:
src  Where to get the file.
dest  Where to put the file.
permissions  May be -1. In this case no special permission mode is set.
overwrite  If true, any existing file will be overwritten.
resume 

MetaInfoJob* fileMetaInfo const KURL::List   items
 

Same as above, but takes a URL list instead of KFileItemList

MetaInfoJob* fileMetaInfo const KFileItemList &    items
 

Retrieves meta information for the given items.

Parameters:
items  files to get metainfo for
save  if the data should be cached for later use
enabledPlugins  if non-zero, this points to a list containing the names of the plugins that may be used. see availablePlugins.

PreviewJob* filePreview const KURL::List   items,
int    width,
int    height = 0,
int    iconSize = 0,
int    iconAlpha = 70,
bool    scale = true,
bool    save = true,
const QStringList *    enabledPlugins = 0
 

Same as above, but takes a URL list instead of KFileItemList

PreviewJob* filePreview const KFileItemList &    items,
int    width,
int    height = 0,
int    iconSize = 0,
int    iconAlpha = 70,
bool    scale = true,
bool    save = true,
const QStringList *    enabledPlugins = 0
 

Generates or retrieves a preview image for the given URL.

Parameters:
items  files to get previews for
width  the maximum width to use
height  the maximum height to use, if this is 0, the same value as width is used.
iconSize  the size of the mimetype icon to overlay over the preview or zero to not overlay an icon. This has no effect if the preview plugin that will be used doesn't use icon overlays.
iconAlpha  transparency to use for the icon overlay
scale  if the image is to be scaled to the requested size or returned in its original size
save  if the image should be cached for later use
enabledPlugins  if non-zero, this points to a list containing the names of the plugins that may be used. see availablePlugins.

QString findDeviceMountPoint const QString &    device
 

Returns the mount point where device is mounted right now. This means, it has to be mounted, not just defined in fstab.

QString findPathMountPoint const QString &    filename
 

Returns the mount point on which resides filename. For instance if /home is a separate partition, findPathMountPoint("/home/user/blah") will return /home

TransferJob* get const KURL   url,
bool    reload = false,
bool    showProgressInfo = true
 

Get (a.k.a. read).

The slave emits the data through data().

TransferJob* http_post const KURL   url,
const QByteArray &    postData,
bool    showProgressInfo = true
 

HTTP POST (for form data).

Example:

    job = KIO::http_post( url, postData, false );
    job->addMetaData("content-type", contentType );
    job->addMetaData("referrer", referrerURL);
 

postData is the data that you want to send and contentType is the complete HTTP header line that specifies the content's MIME type, for example "Content-Type: text/xml".

You MUST specify content-type!

Often contentType is "Content-Type: application/x-www-form-urlencoded" and the postData is then an ASCII string (without null-termination!) with characters like space, linefeed and percent escaped like %20, %0A and %25.

Parameters:
url  Where to write data.
postData  Encoded data to post.
showProgressInfo  true to display

SimpleJob* http_update_cache const KURL   url,
bool    no_cache,
time_t    expireDate
 

HTTP cache update

Parameters:
url  Url to update, protocol must be "http".
no_cache  If true, cache entry for url is deleted.
expireDate  Local machine time indicating when the entry is supposed to expire.

QString itemsSummaryString uint    items,
uint    files,
uint    dirs,
KIO::filesize_t    size,
bool    showSize
 

Helper for showing information about a set of files and directories items = files + dirs + number of symlinks :)

Parameters:
size  the sum of the size of the _files_
showSize  whether to show the size in the result

CopyJob* link const KURL::List   src,
const KURL   destDir,
bool    showProgressInfo = true
 

See also:
link

CopyJob* link const KURL   src,
const KURL   destDir,
bool    showProgressInfo = true
 

Create a link.

Parameters:
src  The existing file or directory, 'target' of the link.
destDir  Destination directory where the link will be created. If the protocols and hosts are the same, a Unix symlink will be created. Otherwise, a .desktop file of Type Link and pointing to the src URL will be created.

CopyJob* linkAs const KURL   src,
const KURL   dest,
bool    showProgressInfo = true
 

See also:
link and copyAs

ListJob* listDir const KURL   url,
bool    showProgressInfo = true,
bool    includeHidden = true
 

List the contents of url, which is assumed to be a directory.

"." and ".." are returned, filter them out if you don't want them.

pass includeHidden = false to cull out UNIX hidden files/dirs (whose names start with .)

ListJob* listRecursive const KURL   url,
bool    showProgressInfo = true,
bool    includeHidden = true
 

The same as the previous method, but recurses subdirectories.

"." and ".." are returned but only for the toplevel directory. Filter them out if you don't want them.

pass includeHidden = false to cull out UNIX hidden files/dirs (whose names start with .)

bool manually_mounted const QString &    filename
 

Checks if the path belongs to a filesystem that is manually mounted.

Parameters:
filename  the file name to check
Returns:
true if the filesystem is manually mounted

int matchConstraint const ParseTreeBase *    _tree,
const KService::Ptr &   ,
const KServiceTypeProfile::OfferList &   
 

Returns:
0 => Does not match 1 => Does match <0 => Error

PreferencesReturn matchPreferences const ParseTreeBase *    _tree,
const KService::Ptr &   ,
const KServiceTypeProfile::OfferList &   
 

Returns:
1 on success or <0 on Error

MimetypeJob* mimetype const KURL   url,
bool    showProgressInfo = true
 

Find mimetype for one file or directory.

SimpleJob* mkdir const KURL   url,
int    permissions = -1
 

Creates a single directory.

Parameters:
url  The URL of the directory to create.
permissions  The permissions to set after creating the directory.
Returns:
A pointer to the job handling the operation.

SimpleJob* mount bool    ro,
const char *    fstype,
const QString &    dev,
const QString &    point,
bool    showProgressInfo = true
 

Mount filesystem.

Special job for kio_file.

Parameters:
ro  Mount read-only if true.
fstype  File system type (e.g. "ext2", can be 0L).
dev  Device (e.g. /dev/sda0).
point  Mount point, can be null.

CopyJob* move const KURL::List   src,
const KURL   dest,
bool    showProgressInfo = true
 

See also:
copy

CopyJob* move const KURL   src,
const KURL   dest,
bool    showProgressInfo = true
 

See also:
copy

CopyJob* moveAs const KURL   src,
const KURL   dest,
bool    showProgressInfo = true
 

See also:
copyAs

QString number KIO::filesize_t    size
 

Converts a size to a string representation Not unlike QString::number(...)

Parameters:
size  size in bytes
Returns:
converted size as a string - e.g. 123456789

bool probably_slow_mounted const QString &    filename
 

Checks if the path belongs to a filesystem that is probably slow. It checks for NFS or for paths belonging to automounted paths not yet mounted

TransferJob* put const KURL   url,
int    permissions,
bool    overwrite,
bool    resume,
bool    showProgressInfo = true
 

Put (a.k.a. write)

Parameters:
url  Where to write data.
permissions  May be -1. In this case no special permission mode is set.
overwrite  If true, any existing file will be overwritten.
resume 

SimpleJob* rename const KURL   src,
const KURL   dest,
bool    overwrite
 

Rename a file or directory. Warning: this operation fails if a direct renaming is not possible (like with files or dirs on separate partitions) Use move or file_move in this case.

Parameters:
src  The original URL
dest  The final URL
overwrite  whether to automatically overwrite if the dest exists
Returns:
The job handling the operation.

SimpleJob* rmdir const KURL   url
 

Removes a single directory.

The directory is assumed to be empty.

Parameters:
url  The URL of the directory to remove.
Returns:
A pointer to the job handling the operation.

SimpleJob* special const KURL   url,
const QByteArray &    data,
bool    showProgressInfo = true
 

Execute any command that is specific to one slave (protocol).

Examples are : HTTP POST, mount and unmount (kio_file)

Parameters:
url  The URL isn't passed to the slave, but is used to know which slave to send it to :-)
data  Packed data. The meaning is completely dependent on the slave, but usually starts with an int for the command number.

StatJob* stat const KURL   url,
bool    sideIsSource,
short int    details,
bool    showProgressInfo = true
 

Find all details for one file or directory. This version of the call includes two additional booleans, sideIsSource and details.

Parameters:
sideIsSource  is true when stating a source file (we will do a get on it if the stat works) and false when stating a destination file (target of a copy).
details  selects the level of details we want. By default this is 2 (all details wanted, including modification time, size, etc.), setDetails(1) is used when deleting: we don't need all the information if it takes too much time, no need to follow symlinks etc. setDetails(0) is used for very simple probing: we'll only get the answer "it's a file or a directory, or it doesn't exist". This is used by KRun.

StatJob* stat const KURL   url,
bool    showProgressInfo = true
 

Find all details for one file or directory.

SimpleJob* symlink const QString &    target,
const KURL   dest,
bool    overwrite,
bool    showProgressInfo = true
 

Create or move a symlink. This is the lowlevel operation, similar to file_copy and file_move. It doesn't do any check (other than those the slave does) and it doesn't show rename and skip dialogs - use KIO::link for that.

Parameters:
target  The string that will become the "target" of the link (can be relative)
dest  The symlink to create.
overwrite  whether to automatically overwrite if the dest exists
Returns:
The job handling the operation.

SimpleJob* unmount const QString &    point,
bool    showProgressInfo = true
 

Unmount filesystem.

Special job for kio_file.

Parameters:
mount  Point to unmount.


Generated on Wed Aug 13 23:30:32 2003 for kdelibs by doxygen1.2.18