kwallet.h
/* This file is part of the KDE project
*
* Copyright (C) 2002-2004 George Staikos <staikos@kde.org>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public License
* along with this library; see the file COPYING.LIB. If not, write to
* the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
#ifndef _KWALLET_H
#define _KWALLET_H
#include <qglobal.h>
#ifdef Q_OS_UNIX
#include <qstring.h>
#include <qstringlist.h>
#include <qobject.h>
#include <dcopobject.h>
class DCOPRef;
namespace KWallet {
class KIO_EXPORT Wallet : public QObject, public DCOPObject {
K_DCOP
Q_OBJECT
protected:
Wallet(int handle, const QString& name);
Wallet(const Wallet&);
public:
enum EntryType { Unknown=0, Password, Stream, Map, Unused=0xffff };
virtual ~Wallet();
static QStringList walletList();
static bool isEnabled();
static bool isOpen(const QString& name);
static int closeWallet(const QString& name, bool force);
static int deleteWallet(const QString& name);
static bool disconnectApplication(const QString& wallet, const QCString& app);
enum OpenType { Synchronous=0, Asynchronous, Path, OpenTypeUnused=0xff };
static Wallet* openWallet(const QString& name, WId w = 0, OpenType ot = Synchronous);
static QStringList users(const QString& wallet);
static const QString LocalWallet();
static const QString NetworkWallet();
static const QString PasswordFolder();
static const QString FormDataFolder();
static void changePassword(const QString& name, WId w = 0);
virtual int sync();
virtual int lockWallet();
virtual const QString& walletName() const;
virtual bool isOpen() const;
virtual void requestChangePassword(WId w = 0);
virtual QStringList folderList();
virtual bool hasFolder(const QString& f);
virtual bool setFolder(const QString& f);
virtual bool removeFolder(const QString& f);
virtual bool createFolder(const QString& f);
virtual const QString& currentFolder() const;
virtual QStringList entryList();
virtual int renameEntry(const QString& oldName, const QString& newName);
virtual int readEntry(const QString& key, QByteArray& value);
virtual int readMap(const QString& key, QMap<QString,QString>& value);
virtual int readPassword(const QString& key, QString& value);
int readEntryList(const QString& key, QMap<QString, QByteArray>& value);
int readMapList(const QString& key, QMap<QString, QMap<QString, QString> >& value);
int readPasswordList(const QString& key, QMap<QString, QString>& value);
virtual int writeEntry(const QString& key, const QByteArray& value, EntryType entryType);
virtual int writeEntry(const QString& key, const QByteArray& value);
virtual int writeMap(const QString& key, const QMap<QString,QString>& value);
virtual int writePassword(const QString& key, const QString& value);
virtual bool hasEntry(const QString& key);
virtual int removeEntry(const QString& key);
virtual EntryType entryType(const QString& key);
static bool folderDoesNotExist(const QString& wallet, const QString& folder);
static bool keyDoesNotExist(const QString& wallet, const QString& folder,
const QString& key);
signals:
void walletClosed();
void folderUpdated(const QString& folder);
void folderListUpdated();
void folderRemoved(const QString& folder);
void walletOpened(bool success);
private:
k_dcop:
ASYNC slotWalletClosed(int handle);
ASYNC slotFolderUpdated(const QString& wallet, const QString& folder);
ASYNC slotFolderListUpdated(const QString& wallet);
ASYNC slotApplicationDisconnected(const QString& wallet, const QCString& application);
ASYNC walletOpenResult(int rc);
private slots:
void slotAppUnregistered(const QCString&);
private:
class WalletPrivate;
WalletPrivate *d;
QString _name;
QString _folder;
int _handle;
DCOPRef *_dcopRef;
protected:
virtual void virtual_hook(int id, void *data);
};
}
#endif //Q_OS_UNIX
#endif //_KWALLET_H
KWallet::Wallet
KDE Wallet.
Definition: kwallet.h:48
DCOPRef
DCOPObject

KDE Home | KDE Accessibility Home | Description of Access Keys