KDE 4.7 PyKDE API Reference

- KDE's Python API

# global Namespace Reference

`from PyKDE4.kdecore import *`

## Detailed Description

## Class Index

A | ItemInt (KCoreConfigSkeleton) | KPtyProcess
KAboutData | ItemIntList (KCoreConfigSkeleton) | R
KAboutLicense | ItemLongLong (KCoreConfigSkeleton) | KRandomSequence
KAboutPerson | ItemPassword (KCoreConfigSkeleton) | S
Action (KAuth) | ItemPath (KCoreConfigSkeleton) | KSaveFile
ActionReply (KAuth) | ItemPathList (KCoreConfigSkeleton) | KService
ActionWatcher (KAuth) | ItemPoint (KCoreConfigSkeleton) | KServiceAction
KAutoSaveFile | ItemProperty (KCoreConfigSkeleton) | KServiceGroup
KAutostart | ItemRect (KCoreConfigSkeleton) | KServiceType
B | ItemSize (KCoreConfigSkeleton) | KServiceTypeTrader
BackgroundChecker (Sonnet) | ItemString (KCoreConfigSkeleton) | KSharedConfig
C | ItemStringList (KCoreConfigSkeleton) | Spec (KDateTime)
KCalendarSystem | ItemUInt (KCoreConfigSkeleton) | Speller (Sonnet)
KCatalogLoader | ItemULongLong (KCoreConfigSkeleton) | KSslCipher
KCharMacroExpander | ItemUrl (KCoreConfigSkeleton) | KSslError
KCharsets | ItemUrlList (KCoreConfigSkeleton) | KSslErrorUiData
Choice (KCoreConfigSkeleton.ItemEnum) | J | KSslKey
Choice2 (KCoreConfigSkeleton.ItemEnum) | KJob | KStandardDirs
KCmdLineArgs | KJobTrackerInterface | KSycoca
KCmdLineOptions | KJobUiDelegate | KSycocaEntry
KComponentData | L | KSystemTimeZone
KCompositeJob | LeapSeconds (KTimeZone) | KSystemTimeZoneBackend
KConfig | KLibLoader | KSystemTimeZones
KConfigBase | KLibrary | KSystemTimeZoneSource
KConfigGroup | List (KUrl) | T
KConfigSkeletonItem | KLocale | KTcpSocket
KCoreConfigSkeleton | KLocalizedDate | KTempDir
KCurrencyCode | KLocalizedString | KTemporaryFile
D | KLocalSocket | KTimeZone
KDateTime | KLocalSocketServer | KTimeZoneBackend
KDEDModule | KLockFile | KTimeZoneData
KDEPluginVerificationData | M | KTimeZones
KDesktopFile | KMacroExpanderBase | KTimeZoneSource
E | KMessageHandler | KToolInvocation
KEncodingDetector | KMimeType | Transition (KTimeZone)
KEncodingProber | KMimeTypeTrader | KTzfileTimeZone
ExtraField (KProtocolInfo) | P | KTzfileTimeZoneBackend
F | Phase (KTimeZone) | KTzfileTimeZoneSource
KFilterBase | KPluginFactory | U
KFilterDev | KPluginInfo | KUrl
I | KPluginLoader | KUser
ItemBool (KCoreConfigSkeleton) | KProcess | KUserGroup
ItemDateTime (KCoreConfigSkeleton) | KProtocolInfo | W
ItemDouble (KCoreConfigSkeleton) | KPty | KWordMacroExpander
ItemEnum (KCoreConfigSkeleton) | KPtyDevice |

## Enumerations

KSycocaFactoryId | { KST_KServiceFactory, KST_KServiceTypeFactory, KST_KServiceGroupFactory, KST_KImageIO, KST_KProtocolInfoFactory, KST_KMimeTypeFactory, KST_CTimeInfo }
KSycocaType | { KST_KSycocaEntry, KST_KService, KST_KServiceType, KST_KMimeType, KST_KFolderMimeType, KST_KDEDesktopMimeType, KST_KMimeTypeEntry, KST_KServiceGroup, KST_KImageIOFormat, KST_KProtocolInfo, KST_KServiceSeparator, KST_KCustom }

## Functions

QString | i18n (QString text, ... a1)
QString | i18n (QString text)
QString | i18nc (QString ctxt, QString text, ... a2)
QString | i18nc (QString ctxt, QString text)
QString | i18ncp (QString ctxt, QString sing, QString plur, ... a3)
QString | i18np (QString sing, QString plur, ... a2)
QString | kAsciiToLower (QString str)
QString | kAsciiToUpper (QString str)
int | kasciistricmp (QString str1, QString str2)
KLocalizedString | ki18n (QString msg)
KLocalizedString | ki18nc (QString ctxt, QString msg)
KLocalizedString | ki18ncp (QString ctxt, QString singular, QString plural)
KLocalizedString | ki18np (QString singular, QString plural)
QDataStream | operator << (QDataStream out, KDateTime.Spec spec)
QDataStream | operator << (QDataStream out, KDateTime dateTime)
QDataStream | operator << (QDataStream out, KLocalizedDate date)
QDebug | operator << (QDebug debug, KLocalizedDate date)
QDataStream | operator << (QDataStream s, KProtocolInfo.ExtraField field)
QDataStream | operator << (QDataStream str, KServiceAction act)
QDataStream | operator >> (QDataStream in, KDateTime.Spec spec)
QDataStream | operator >> (QDataStream in, KDateTime dateTime)
QDataStream | operator >> (QDataStream in, KLocalizedDate date)
QDataStream | operator >> (QDataStream s, KProtocolInfo.ExtraField field)
QDataStream | operator >> (QDataStream str, KServiceAction act)
long | qHash (KPluginInfo a0)
long | qHash (KUrl kurl)
QString | tr2i18n (QString message, QString comment=0)
bool | urlcmp (QString _url1, QString _url2)
bool | urlcmp (QString _url1, QString _url2, KUrl.EqualsOptions options)

## Enumeration Documentation

KSycocaFactoryId

A KSycocaFactoryId is a code (out of the KSycocaFactoryId enum) assigned to each class type derived from KSycocaFactory. To use it, call the macro K_SYCOCAFACTORY( your_factory_id ) at the top of your class definition.

Enumerator:

  KST_KServiceFactory = 1 |
  KST_KServiceTypeFactory = 2 |
  KST_KServiceGroupFactory = 3 |
  KST_KImageIO = 4 |
  KST_KProtocolInfoFactory = 5 |
  KST_KMimeTypeFactory = 6 |
  KST_CTimeInfo = 100 |

KSycocaType

A KSycocaType is a code (out of the KSycocaType enum) assigned to each class type derived from KSycocaEntry . To use it, call the macro K_SYCOCATYPE( your_typecode, parent_class ) at the top of your class definition.

Enumerator:

  KST_KSycocaEntry = 0 |
  KST_KService = 1 |
  KST_KServiceType = 2 |
  KST_KMimeType = 3 |
  KST_KFolderMimeType = 4 |
  KST_KDEDesktopMimeType = 5 |
  KST_KMimeTypeEntry = 6 |
  KST_KServiceGroup = 7 |
  KST_KImageIOFormat = 8 |
  KST_KProtocolInfo = 9 |
  KST_KServiceSeparator = 10 |
  KST_KCustom = 1000 |

## Function Documentation

QString i18n | ( | QString | text,
|  | ... | a1
| ) |  |  |

Returns a localized version of a string with 9 arguments.

Parameters:

  | text | string to be localized
  | a1 | first argument
  | a2 | second argument
  | a3 | third argument
  | a4 | fourth argument
  | a5 | fifth argument
  | a6 | sixth argument
  | a7 | seventh argument
  | a8 | eighth argument
  | a9 | ninth argument

Returns:
  localized string

QString i18n | ( | QString | text
| ) |  |  |

Returns a localized version of a string with 9 arguments.

Parameters:

  | text | string to be localized
  | a1 | first argument
  | a2 | second argument
  | a3 | third argument
  | a4 | fourth argument
  | a5 | fifth argument
  | a6 | sixth argument
  | a7 | seventh argument
  | a8 | eighth argument
  | a9 | ninth argument

Returns:
  localized string

QString i18nc | ( | QString | ctxt,
|  | QString | text,
|  | ... | a2
| ) |  |  |

Returns a localized version of a string with 9 arguments and a context.

Parameters:

  | ctxt | context of the string
  | text | string to be localized
  | a1 | first argument
  | a2 | second argument
  | a3 | third argument
  | a4 | fourth argument
  | a5 | fifth argument
  | a6 | sixth argument
  | a7 | seventh argument
  | a8 | eighth argument
  | a9 | ninth argument

Returns:
  localized string

QString i18nc | ( | QString | ctxt,
|  | QString | text
| ) |  |  |

Returns a localized version of a string with 9 arguments and a context.

Parameters:

  | ctxt | context of the string
  | text | string to be localized
  | a1 | first argument
  | a2 | second argument
  | a3 | third argument
  | a4 | fourth argument
  | a5 | fifth argument
  | a6 | sixth argument
  | a7 | seventh argument
  | a8 | eighth argument
  | a9 | ninth argument

Returns:
  localized string

QString i18ncp | ( | QString | ctxt,
|  | QString | sing,
|  | QString | plur,
|  | ... | a3
| ) |  |  |

Returns a localized version of a string with 9 arguments and a context using correct plural form.

Parameters:

  | ctxt | context of the string
  | sing | string to be localized in singular
  | plur | string to be localized in plural
  | a1 | first argument
  | a2 | second argument
  | a3 | third argument
  | a4 | fourth argument
  | a5 | fifth argument
  | a6 | sixth argument
  | a7 | seventh argument
  | a8 | eighth argument
  | a9 | ninth argument

Returns:
  localized string

QString i18np | ( | QString | sing,
|  | QString | plur,
|  | ... | a2
| ) |  |  |

Returns a localized version of a string with 9 arguments using correct plural form.

Parameters:

  | sing | string to be localized in singular
  | plur | string to be localized in plural
  | a1 | first argument
  | a2 | second argument
  | a3 | third argument
  | a4 | fourth argument
  | a5 | fifth argument
  | a6 | sixth argument
  | a7 | seventh argument
  | a8 | eighth argument
  | a9 | ninth argument

Returns:
  localized string

QString kAsciiToLower | ( | QString | str
| ) |  |  |

Locale-independent function to convert ASCII strings to lower case ASCII strings. This means that it affects only the ASCII characters A-Z.

Parameters:

  | str | pointer to the string which should be converted to lower case

Returns:
  pointer to the converted string (same as str)

QString kAsciiToUpper | ( | QString | str
| ) |  |  |

Locale-independent function to convert ASCII strings to upper case ASCII strings. This means that it affects only the ASCII characters a-z.

Parameters:

  | str | pointer to the string which should be converted to upper case

Returns:
  pointer to the converted string (same as str)

int kasciistricmp | ( | QString | str1,
|  | QString | str2
| ) |  |  |

Locale-independent qstricmp. Use this for comparing ascii keywords in a case-insensitive way. qstricmp fails with e.g. the Turkish locale where 'I'.toLower() != 'i'

KLocalizedString ki18n | ( | QString | msg
| ) |  |  |

Creates localized string from a given message. Normaly you should use i18n() templates instead, as you need real KLocalizedString object only in special cases. All text arguments must be UTF-8 encoded and must not be empty or NULL.

Parameters:

  | msg | message text

Returns:
  created KLocalizedString

KLocalizedString ki18nc | ( | QString | ctxt,
|  | QString | msg
| ) |  |  |

Creates localized string from a given message, with added context. Context is only for disambiguation purposes (both for lookup and for translators), it is not part of the message. Normaly you should use i18nc() templates instead, as you need real KLocalizedString object only in special cases. All text arguments must be UTF-8 encoded and must not be empty or NULL.

Parameters:

  | ctxt | context text
  | msg | message text

Returns:
  created KLocalizedString

KLocalizedString ki18ncp | ( | QString | ctxt,
|  | QString | singular,
|  | QString | plural
| ) |  |  |

Creates localized string from a given plural and singular form, with added context. Context is only for disambiguation purposes (both for lookup and for translators), it is not part of the message. Normaly you should use i18ncp() templates instead, as you need real KLocalizedString object only in special cases. All text arguments must be UTF-8 encoded and must not be empty or NULL.

Parameters:

  | ctxt | context text
  | singular | message text in singular
  | plural | message text in plural

Returns:
  created KLocalizedString

KLocalizedString ki18np | ( | QString | singular,
|  | QString | plural
| ) |  |  |

Creates localized string from a given plural and singular form. Normaly you should use i18np() templates instead, as you need real KLocalizedString object only in special cases. All text arguments must be UTF-8 encoded and must not be empty or NULL.

Parameters:

  | singular | message text in singular
  | plural | message text in plural

Returns:
  created KLocalizedString

QDataStream operator << | ( | QDataStream | out,
|  | KDateTime.Spec | spec
| ) |  |  |

Debug stream output operator

Parameters:

  | debug | the debug datastream to write to
  | date | the date to write to the stream

QDataStream operator << | ( | QDataStream | out,
|  | KDateTime | dateTime
| ) |  |  |

Debug stream output operator

Parameters:

  | debug | the debug datastream to write to
  | date | the date to write to the stream

QDataStream operator << | ( | QDataStream | out,
|  | KLocalizedDate | date
| ) |  |  |

Debug stream output operator

Parameters:

  | debug | the debug datastream to write to
  | date | the date to write to the stream

QDebug operator << | ( | QDebug | debug,
|  | KLocalizedDate | date
| ) |  |  |

Debug stream output operator

Parameters:

  | debug | the debug datastream to write to
  | date | the date to write to the stream

QDataStream operator << | ( | QDataStream | s,
|  | KProtocolInfo.ExtraField | field
| ) |  |  |

Debug stream output operator

Parameters:

  | debug | the debug datastream to write to
  | date | the date to write to the stream

QDataStream operator << | ( | QDataStream | str,
|  | KServiceAction | act
| ) |  |  |

Debug stream output operator

Parameters:

  | debug | the debug datastream to write to
  | date | the date to write to the stream

QDataStream operator >> | ( | QDataStream | in,
|  | KDateTime.Spec | spec
| ) |  |  |

\class KProtocolInfo kprotocolinfo.h <KProtocolInfo>

Information about I/O (Internet, etc.) protocols supported by KDE.

This class is useful if you want to know which protocols KDE supports. In addition you can find out lots of information about a certain protocol. A KProtocolInfo instance represents a single protocol. Most of the functionality is provided by the static methods that scan the *.protocol files of all installed kioslaves to get this information.

*.protocol files are installed in the "services" resource.

Author:
  Torben Weis <weis@kde.org>

QDataStream operator >> | ( | QDataStream | in,
|  | KDateTime | dateTime
| ) |  |  |

\class KProtocolInfo kprotocolinfo.h <KProtocolInfo>

Information about I/O (Internet, etc.) protocols supported by KDE.

This class is useful if you want to know which protocols KDE supports. In addition you can find out lots of information about a certain protocol. A KProtocolInfo instance represents a single protocol. Most of the functionality is provided by the static methods that scan the *.protocol files of all installed kioslaves to get this information.

*.protocol files are installed in the "services" resource.

Author:
  Torben Weis <weis@kde.org>

QDataStream operator >> | ( | QDataStream | in,
|  | KLocalizedDate | date
| ) |  |  |

\class KProtocolInfo kprotocolinfo.h <KProtocolInfo>

Information about I/O (Internet, etc.) protocols supported by KDE.

This class is useful if you want to know which protocols KDE supports. In addition you can find out lots of information about a certain protocol. A KProtocolInfo instance represents a single protocol. Most of the functionality is provided by the static methods that scan the *.protocol files of all installed kioslaves to get this information.

*.protocol files are installed in the "services" resource.

Author:
  Torben Weis <weis@kde.org>

QDataStream operator >> | ( | QDataStream | s,
|  | KProtocolInfo.ExtraField | field
| ) |  |  |

\class KProtocolInfo kprotocolinfo.h <KProtocolInfo>

Information about I/O (Internet, etc.) protocols supported by KDE.

This class is useful if you want to know which protocols KDE supports. In addition you can find out lots of information about a certain protocol. A KProtocolInfo instance represents a single protocol. Most of the functionality is provided by the static methods that scan the *.protocol files of all installed kioslaves to get this information.

*.protocol files are installed in the "services" resource.

Author:
  Torben Weis <weis@kde.org>

QDataStream operator >> | ( | QDataStream | str,
|  | KServiceAction | act
| ) |  |  |

\class KProtocolInfo kprotocolinfo.h <KProtocolInfo>

Information about I/O (Internet, etc.) protocols supported by KDE.

This class is useful if you want to know which protocols KDE supports. In addition you can find out lots of information about a certain protocol. A KProtocolInfo instance represents a single protocol. Most of the functionality is provided by the static methods that scan the *.protocol files of all installed kioslaves to get this information.

*.protocol files are installed in the "services" resource.

Author:
  Torben Weis <weis@kde.org>

long qHash | ( | KPluginInfo | a0
| ) |  |  |

Information about a plugin.

This holds all the information about a plugin there is. It's used for the user to decide whether he wants to use this plugin or not.

Author:
  Matthias Kretz <kretz@kde.org>

long qHash | ( | KUrl | kurl
| ) |  |  |

Information about a plugin.

This holds all the information about a plugin there is. It's used for the user to decide whether he wants to use this plugin or not.

Author:
  Matthias Kretz <kretz@kde.org>

QString tr2i18n | ( | QString | message,
|  | QString | comment=0
| ) |  |  |

Qt's uic generated translation calls go through numerous indirections unnecessary in our case. So we use uic -tr tr2i18n to redirect them to our i18n API.

bool urlcmp | ( | QString | _url1,
|  | QString | _url2
| ) |  |  |

Compares URLs. They are parsed, split and compared. Two malformed URLs with the same string representation are nevertheless considered to be unequal. That means no malformed URL equals anything else.

Parameters:

  | _url1 | A reference URL
  | _url2 | A URL that will be compared with the reference URL
  | options | a set of KUrl.EqualsOption flags

Deprecated:
  use KUrl(_url1).equals(KUrl(_url2), options) instead.

bool urlcmp | ( | QString | _url1,
|  | QString | _url2,
|  | KUrl.EqualsOptions | options
| ) |  |  |

Compares URLs. They are parsed, split and compared. Two malformed URLs with the same string representation are nevertheless considered to be unequal. That means no malformed URL equals anything else.

Parameters:

  | _url1 | A reference URL
  | _url2 | A URL that will be compared with the reference URL
  | options | a set of KUrl.EqualsOption flags

Deprecated:
  use KUrl(_url1).equals(KUrl(_url2), options) instead.