• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • kio/kio
 

kio/kio

Classes | Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Static Protected Member Functions
KDEDesktopMimeType Class Reference

#include <kmimetype.h>

Inheritance diagram for KDEDesktopMimeType:
KMimeType KServiceType

List of all members.

Classes

struct  Service
 Structure representing a service, in the list of services returned by builtinServices and userDefinedServices. More...

Public Types

enum  ServiceType { ST_MOUNT, ST_UNMOUNT, ST_USER_DEFINED }

Public Member Functions

 KDEDesktopMimeType (KDesktopFile *config)
 KDEDesktopMimeType (TQDataStream &_str, int offset)
virtual TQString icon (const TQString &_url, bool _is_local) const
virtual TQString icon (const KURL &_url, bool _is_local) const
virtual TQPixmap pixmap (const KURL &_url, KIcon::Group _group, int _force_size=0, int _state=0, TQString *_path=0L) const
virtual TQString comment (const TQString &_url, bool _is_local) const
virtual TQString comment (const KURL &_url, bool _is_local) const

Static Public Member Functions

static TQValueList< Service > builtinServices (const KURL &_url)
static TQValueList< Service > userDefinedServices (const TQString &path, bool bLocalFiles)
static TQValueList< Service > userDefinedServices (const TQString &path, KConfig &config, bool bLocalFiles)
static TQValueList< Service > userDefinedServices (const TQString &path, KConfig &config, bool bLocalFiles, const KURL::List &file_list)
static void executeService (const TQString &path, KDEDesktopMimeType::Service &service) KDE_DEPRECATED
static void executeService (const KURL::List &urls, KDEDesktopMimeType::Service &service)
static pid_t run (const KURL &_url, bool _is_local)

Protected Member Functions

virtual TQPixmap pixmap (KIcon::Group group, int force_size=0, int state=0, TQString *path=0L) const
virtual void virtual_hook (int id, void *data)

Static Protected Member Functions

static pid_t runFSDevice (const KURL &_url, const KSimpleConfig &cfg)
static pid_t runApplication (const KURL &_url, const TQString &_serviceFile)
static pid_t runLink (const KURL &_url, const KSimpleConfig &cfg)
static pid_t runMimeType (const KURL &_url, const KSimpleConfig &cfg)

Detailed Description

Mime type for desktop files.

Handles mount/umount icon, and user-defined properties. Mimetype for a .desktop file

Definition at line 506 of file kmimetype.h.


Constructor & Destructor Documentation

KDEDesktopMimeType::KDEDesktopMimeType ( KDesktopFile *  config) [inline]

Construct a desktop mimetype and take all information from a desktop file.

Parameters:
configthe desktop configuration file that describes the mime type

Definition at line 534 of file kmimetype.h.


Member Function Documentation

TQValueList< KDEDesktopMimeType::Service > KDEDesktopMimeType::builtinServices ( const KURL &  _url) [static]

Returns a list of services for the given .desktop file that are handled by kio itself.

Namely mount/unmount for FSDevice files.

Returns:
the list of services

Definition at line 920 of file kmimetype.cpp.

TQString KDEDesktopMimeType::comment ( const TQString &  ,
bool   
) const [virtual]

Returns the descriptive comment associated with the MIME type.

The arguments are unused, but provided so that KMimeType derived classes can use them.

Returns:
The descriptive comment associated with the MIME type, if any.

Reimplemented from KMimeType.

Definition at line 768 of file kmimetype.cpp.

TQString KDEDesktopMimeType::comment ( const KURL &  ,
bool   
) const [virtual]

Returns the descriptive comment associated with the MIME type.

The arguments are unused, but provided so that KMimeType derived classes can use them.

Returns:
The descriptive comment associated with the MIME type, if any.

Reimplemented from KMimeType.

Definition at line 777 of file kmimetype.cpp.

void KDEDesktopMimeType::executeService ( const TQString &  path,
KDEDesktopMimeType::Service &  service 
) [static]
Parameters:
pathis the path of the desktop entry.
servicethe service to execute
Deprecated:
, see the other executeService

Definition at line 1087 of file kmimetype.cpp.

void KDEDesktopMimeType::executeService ( const KURL::List &  urls,
KDEDesktopMimeType::Service &  service 
) [static]

Execute service on the list of urls.

Parameters:
urlsthe list of urls
servicethe service to execute

Definition at line 1096 of file kmimetype.cpp.

TQString KDEDesktopMimeType::icon ( const TQString &  ,
bool   
) const [virtual]

Return the filename of the icon associated with the mimetype.

The arguments are unused, but provided so that KMimeType-derived classes can use them (e.g. KFolderType uses the URL to return one out of 2 icons)

Returns:
The path to the icon associated with this MIME type.

Reimplemented from KMimeType.

Definition at line 702 of file kmimetype.cpp.

TQString KDEDesktopMimeType::icon ( const KURL &  ,
bool   
) const [virtual]

Return the filename of the icon associated with the mimetype.

The arguments are unused, but provided so that KMimeType-derived classes can use them (e.g. KFolderType uses the URL to return one out of 2 icons)

Returns:
The path to the icon associated with this MIME type.

Reimplemented from KMimeType.

Definition at line 711 of file kmimetype.cpp.

TQPixmap KDEDesktopMimeType::pixmap ( const KURL &  _url,
KIcon::Group  _group,
int  _force_size = 0,
int  _state = 0,
TQString *  _path = 0L 
) const [virtual]

Find the pixmap for a given file of this mimetype.

Convenience method that uses icon(), but also locates and load the pixmap.

Parameters:
_urlURL for the file.
_groupThe icon group where the icon is going to be used.
_force_sizeOverride globallly configured icon size. Use 0 for the default size
_stateThe icon state, one of: KIcon::DefaultState, KIcon::ActiveState or KIcon::DisabledState.
_pathOutput parameter to get the full path. Seldom needed. Ignored if 0
Returns:
the pixmap of the URL, can be a default icon if not found

Reimplemented from KMimeType.

Definition at line 756 of file kmimetype.cpp.

virtual TQPixmap KDEDesktopMimeType::pixmap ( KIcon::Group  group,
int  force_size = 0,
int  state = 0,
TQString *  path = 0L 
) const [inline, protected, virtual]

Use this function only if you don't have a special URL for which you search a pixmap.

This function is useful to find out, which icon is usually chosen for a certain mime type. Since no URL is passed, it is impossible to obey icon hints in desktop entries for example.

Parameters:
groupThe icon group where the icon is going to be used.
force_sizeOverride globallly configured icon size. Use 0 for the default size
stateThe icon state, one of: KIcon::DefaultState, KIcon::ActiveState or KIcon::DisabledState.
pathOutput parameter to get the full path. Seldom needed. Ignored if 0
Returns:
the pixmap of the mime type, can be a default icon if not found

Reimplemented from KMimeType.

Definition at line 606 of file kmimetype.h.

pid_t KDEDesktopMimeType::run ( const KURL &  _url,
bool  _is_local 
) [static]

Invokes the default action for the desktop entry.

If the desktop entry is not local, then only false is returned. Otherwise we would create a security problem. Only types Link and Mimetype could be followed.

Parameters:
_urlthe url to run
_is_localtrue if the URL is local, false otherwise
Returns:
true on success and false on failure.
See also:
KRun::runURL

Definition at line 790 of file kmimetype.cpp.

TQValueList< KDEDesktopMimeType::Service > KDEDesktopMimeType::userDefinedServices ( const TQString &  path,
bool  bLocalFiles 
) [static]

Returns a list of services defined by the user as possible actions on the given .desktop file.

May include empty actions which represent where visual separators should appear in user-visible representations of those actions, such as separators in a menu.

Parameters:
paththe path to the desktop file describing the services
bLocalFilestrue if those services are to be applied to local files only (if false, services that don't have u or U in the Exec line won't be taken into account).
Returns:
the list of user deviced actions

Definition at line 973 of file kmimetype.cpp.

TQValueList< KDEDesktopMimeType::Service > KDEDesktopMimeType::userDefinedServices ( const TQString &  path,
KConfig &  config,
bool  bLocalFiles 
) [static]

Overload of userDefinedServices for speed purposes: it takes a KConfig* so that the caller can check things in the file without having it parsed twice.

Since:
3.4

Definition at line 979 of file kmimetype.cpp.

TQValueList< KDEDesktopMimeType::Service > KDEDesktopMimeType::userDefinedServices ( const TQString &  path,
KConfig &  config,
bool  bLocalFiles,
const KURL::List &  file_list 
) [static]

Overload of userDefinedServices but also allows you to pass a list of urls for this file.

This allows for the menu to be changed depending on the exact files via the X-KDE-GetActionMenu extension.

Since:
3.5

Definition at line 984 of file kmimetype.cpp.


The documentation for this class was generated from the following files:
  • kmimetype.h
  • kmimetype.cpp

kio/kio

Skip menu "kio/kio"
  • Main Page
  • Modules
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

kio/kio

Skip menu "kio/kio"
  • arts
  • dcop
  • dnssd
  • interfaces
  •     interface
  •     library
  •   kspeech
  •   ktexteditor
  • kabc
  • kate
  • kcmshell
  • kdecore
  • kded
  • kdefx
  • kdeprint
  • kdesu
  • kdeui
  • kdoctools
  • khtml
  • kimgio
  • kinit
  • kio
  •   bookmarks
  •   httpfilter
  •   kfile
  •   kio
  •   kioexec
  •   kpasswdserver
  •   kssl
  • kioslave
  •   http
  • kjs
  • kmdi
  •   kmdi
  • knewstuff
  • kparts
  • krandr
  • kresources
  • kspell2
  • kunittest
  • kutils
  • kwallet
  • libkmid
  • libkscreensaver
Generated for kio/kio by doxygen 1.7.6.1
This website is maintained by Timothy Pearson.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. |