KDE PIM / Developers / API Docs / libkdepim

KPIM Namespace Reference

KDEPIM classes for drag and drop of mails. More...

Classes

Namespaces

Typedefs

Functions

Variables


Detailed Description

KDEPIM classes for drag and drop of mails.

// Code example for drag and drop enabled widget

void SomeWidget::contentsDropEvent(QDropEvent *e) { if (e->provides(MailListDrag::format())) { MailList mailList; MailListDrag::decode( e, mailList ); ...


Function Documentation

QCString KPIM::kFileToString const QString &  fileName,
bool  ensureNewline = true,
bool  withDialogs = true
 

Load a file.

Returns a pointer to the memory-block that contains the loaded file. Returns a null string if the file could not be loaded. If withDialogs is FALSE no warning dialogs are opened if there are problems. The string returned is always zero-terminated and therefore one byte longer than the file itself. If ensureNewline is TRUE the string will always have a trailing newline.

bool KPIM::kBytesToFile const char *  aBuffer,
int  len,
const QString &  aFileName,
bool  aAskIfExists,
bool  aBackup,
bool  aVerbose
 

Save a file.

If withDialogs is FALSE no warning dialogs are opened if there are problems. Returns TRUE on success and FALSE on failure. Replaces existing files without warning if askIfExists==FALSE. Makes a copy if the file exists to filename~ if createBackup==TRUE.

KDE_EXPORT bool KPIM::kByteArrayToFile const QByteArray &  buffer,
const QString &  fileName,
bool  askIfExists = false,
bool  createBackup = true,
bool  withDialogs = true
 

Does not stop at NUL.

QString KPIM::checkAndCorrectPermissionsIfPossible const QString &  toCheck,
const bool &  recursive,
const bool &  wantItReadable,
const bool &  wantItWritable
 

Checks and corrects the permissions of a file or folder, and if requested all files and folders below.

It gives back a list of files which do not have the right permissions. This list can be used to show to the user.

Parameters:
toCheck The file or folder of which the permissions should be checked.
recursive Set to true, it will check the contents of a folder for the permissions recursively. If false only toCheck will be checked.
wantItReadable Set to true, it will check for read permissions. If the read permissions are not available, there will be a attempt to correct this.
wantItWritable Set to true, it will check for write permissions. If the write permissions are not available, there will be a attempt to correct this.
Returns:
It will return a string with all files and folders which do not have the right permissions. If empty, then all permissions are ok.

bool KPIM::checkAndCorrectPermissionsIfPossibleWithErrorHandling QWidget *  parent,
const QString &  toCheck,
const bool &  recursive,
const bool &  wantItReadable,
const bool &  wantItWritable
 

Checks and corrects the permissions of a file or folder, and if requested all files and folders below.

If the permissions are not ok, it tries to correct them. If that fails then a warning with detailled information is given.

Parameters:
parent If parent is 0, then the message box becomes an application-global modal dialog box. If parent is a widget, the message box becomes modal relative to parent.
toCheck The file or folder of which the permissions should be checked.
recursive Set to true, it will check the contents of a folder for the permissions recursively. If false only toCheck will be checked.
wantItReadable Set to true, it will check for read permissions. If the read permissions are not available, there will be a attempt to correct this.
wantItWritable Set to true, it will check for write permissions. If the write permissions are not available, there will be a attempt to correct this.
Returns:
It will return true if all permissions in the end are ok. If false then the permissions are not ok and it was not possible to correct all errors.