• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdelibs API Reference
  • KDE Home
  • Contact Us
 

KDEUI

  • KWallet
  • Wallet
Public Types | Signals | Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
KWallet::Wallet Class Reference

#include <kwallet.h>

Inheritance diagram for KWallet::Wallet:
Inheritance graph
[legend]

Public Types

enum  EntryType {
  Unknown =0, Password, Stream, Map,
  Unused =0xffff
}
 
enum  OpenType { Synchronous =0, Asynchronous, Path, OpenTypeUnused =0xff }
 

Signals

void folderListUpdated ()
 
void folderRemoved (const QString &folder)
 
void folderUpdated (const QString &folder)
 
void walletClosed ()
 
void walletOpened (bool success)
 

Public Member Functions

virtual ~Wallet ()
 
virtual bool createFolder (const QString &f)
 
virtual const QString & currentFolder () const
 
virtual QStringList entryList ()
 
virtual EntryType entryType (const QString &key)
 
virtual QStringList folderList ()
 
virtual bool hasEntry (const QString &key)
 
virtual bool hasFolder (const QString &f)
 
virtual bool isOpen () const
 
virtual int lockWallet ()
 
virtual int readEntry (const QString &key, QByteArray &value)
 
int readEntryList (const QString &key, QMap< QString, QByteArray > &value)
 
virtual int readMap (const QString &key, QMap< QString, QString > &value)
 
int readMapList (const QString &key, QMap< QString, QMap< QString, QString > > &value)
 
virtual int readPassword (const QString &key, QString &value)
 
int readPasswordList (const QString &key, QMap< QString, QString > &value)
 
virtual int removeEntry (const QString &key)
 
virtual bool removeFolder (const QString &f)
 
virtual int renameEntry (const QString &oldName, const QString &newName)
 
virtual void requestChangePassword (WId w)
 
virtual bool setFolder (const QString &f)
 
virtual int sync ()
 
virtual const QString & walletName () const
 
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)
 
- Public Member Functions inherited from QObject
 QObject (QObject *parent)
 
 QObject (QObject *parent, const char *name)
 
virtual  ~QObject ()
 
bool blockSignals (bool block)
 
QObject * child (const char *objName, const char *inheritsClass, bool recursiveSearch) const
 
const QObjectList & children () const
 
const char * className () const
 
bool connect (const QObject *sender, const char *signal, const char *method, Qt::ConnectionType type) const
 
void deleteLater ()
 
void destroyed (QObject *obj)
 
bool disconnect (const QObject *receiver, const char *method)
 
bool disconnect (const char *signal, const QObject *receiver, const char *method)
 
void dumpObjectInfo ()
 
void dumpObjectTree ()
 
QList< QByteArray > dynamicPropertyNames () const
 
virtual bool event (QEvent *e)
 
virtual bool eventFilter (QObject *watched, QEvent *event)
 
T findChild (const QString &name) const
 
QList< T > findChildren (const QRegExp &regExp) const
 
QList< T > findChildren (const QString &name) const
 
bool inherits (const char *className) const
 
void insertChild (QObject *object)
 
void installEventFilter (QObject *filterObj)
 
bool isA (const char *className) const
 
bool isWidgetType () const
 
void killTimer (int id)
 
virtual const QMetaObject * metaObject () const
 
void moveToThread (QThread *targetThread)
 
const char * name () const
 
const char * name (const char *defaultName) const
 
QString objectName () const
 
QObject * parent () const
 
QVariant property (const char *name) const
 
void removeChild (QObject *object)
 
void removeEventFilter (QObject *obj)
 
void setName (const char *name)
 
void setObjectName (const QString &name)
 
void setParent (QObject *parent)
 
bool setProperty (const char *name, const QVariant &value)
 
bool signalsBlocked () const
 
int startTimer (int interval)
 
QThread * thread () const
 

Static Public Member Functions

static void changePassword (const QString &name, WId w)
 
static int closeWallet (const QString &name, bool force)
 
static int deleteWallet (const QString &name)
 
static bool disconnectApplication (const QString &wallet, const QString &app)
 
static bool folderDoesNotExist (const QString &wallet, const QString &folder)
 
static const QString FormDataFolder ()
 
static bool isEnabled ()
 
static bool isOpen (const QString &name)
 
static bool isUsingKSecretsService ()
 
static bool keyDoesNotExist (const QString &wallet, const QString &folder, const QString &key)
 
static const QString LocalWallet ()
 
static const QString NetworkWallet ()
 
static Wallet * openWallet (const QString &name, WId w, OpenType ot=Synchronous)
 
static const QString PasswordFolder ()
 
static QStringList users (const QString &wallet)
 
static QStringList walletList ()
 
- Static Public Member Functions inherited from QObject
bool connect (const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
 
bool connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type)
 
bool disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *method)
 
bool disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method)
 
QString tr (const char *sourceText, const char *disambiguation, int n)
 
QString trUtf8 (const char *sourceText, const char *disambiguation, int n)
 

Protected Member Functions

 Wallet (int handle, const QString &name)
 
 Wallet (const Wallet &)
 
virtual void virtual_hook (int id, void *data)
 
- Protected Member Functions inherited from QObject
bool checkConnectArgs (const char *signal, const QObject *object, const char *method)
 
virtual void childEvent (QChildEvent *event)
 
virtual void connectNotify (const char *signal)
 
virtual void customEvent (QEvent *event)
 
virtual void disconnectNotify (const char *signal)
 
int receivers (const char *signal) const
 
QObject * sender () const
 
int senderSignalIndex () const
 
virtual void timerEvent (QTimerEvent *event)
 

Additional Inherited Members

- Static Protected Member Functions inherited from QObject
QByteArray normalizeSignalSlot (const char *signalSlot)
 
- Properties inherited from QObject
 objectName
 

Detailed Description

KDE Wallet.

This class implements a generic system-wide Wallet for KDE. This is the ONLY public interface.

Author
George Staikos staik.nosp@m.os@k.nosp@m.de.or.nosp@m.g KDE Wallet Class

Definition at line 62 of file kwallet.h.

Member Enumeration Documentation

enum KWallet::Wallet::EntryType
Enumerator
Unknown 
Password 
Stream 
Map 
Unused 

Definition at line 80 of file kwallet.h.

enum KWallet::Wallet::OpenType
Enumerator
Synchronous 
Asynchronous 
Path 
OpenTypeUnused 

Definition at line 135 of file kwallet.h.

Constructor & Destructor Documentation

Wallet::Wallet ( int  handle,
const QString &  name 
)
protected

Construct a KWallet object.

Parameters
handleThe handle for the wallet.
nameThe name of the wallet.

Definition at line 243 of file kwallet.cpp.

KWallet::Wallet::Wallet ( const Wallet &  )
protected

Copy a KWallet object.

Wallet::~Wallet ( )
virtual

Destroy a KWallet object.

Closes the wallet.

Definition at line 272 of file kwallet.cpp.

Member Function Documentation

void Wallet::changePassword ( const QString &  name,
WId  w 
)
static

Request to the wallet service to change the password of the wallet name.

Parameters
nameThe the wallet to change the password of.
wThe window id to associate any dialogs with. You can pass 0 if you don't have a window the password dialog should associate with.

Definition at line 328 of file kwallet.cpp.

int Wallet::closeWallet ( const QString &  name,
bool  force 
)
static

Close the wallet name.

The wallet will only be closed if it is open but not in use (rare), or if it is forced closed.

Parameters
nameThe name of the wallet to close.
forceSet true to force the wallet closed even if it is in use by others.
Returns
Returns 0 on success, non-zero on error.

Definition at line 403 of file kwallet.cpp.

bool Wallet::createFolder ( const QString &  f)
virtual

Created the folder f.

Parameters
fthe name of the folder to create
Returns
Returns true if the folder was successfully created.

Definition at line 849 of file kwallet.cpp.

const QString & Wallet::currentFolder ( ) const
virtual

Determine the current working folder in the wallet.

If the folder name is empty, it is working in the global folder, which is valid but discouraged.

Returns
Returns the current working folder.

Definition at line 968 of file kwallet.cpp.

int Wallet::deleteWallet ( const QString &  name)
static

Delete the wallet name.

The wallet will be forced closed first.

Parameters
nameThe name of the wallet to delete.
Returns
Returns 0 on success, non-zero on error.

Definition at line 426 of file kwallet.cpp.

bool Wallet::disconnectApplication ( const QString &  wallet,
const QString &  app 
)
static

Disconnect the application app from wallet.

Parameters
walletThe name of the wallet to disconnect.
appThe name of the application to disconnect.
Returns
Returns true on success, false on error.

Definition at line 560 of file kwallet.cpp.

QStringList Wallet::entryList ( )
virtual

Return the list of keys of all entries in this folder.

Returns
Returns an empty list if the wallet is not open, or if the folder is empty.

Definition at line 777 of file kwallet.cpp.

Wallet::EntryType Wallet::entryType ( const QString &  key)
virtual

Determine the type of the entry key in this folder.

Parameters
keyThe key to look up.
Returns
Returns an enumerated type representing the type of the entry.

Definition at line 1471 of file kwallet.cpp.

bool Wallet::folderDoesNotExist ( const QString &  wallet,
const QString &  folder 
)
static

Determine if a folder does not exist in a wallet.

This does not require decryption of the wallet. This is a handy optimization to avoid prompting the user if your data is certainly not in the wallet.

Parameters
walletThe wallet to look in.
folderThe folder to look up.
Returns
Returns true if the folder does NOT exist in the wallet, or the wallet does not exist.

Definition at line 1603 of file kwallet.cpp.

QStringList Wallet::folderList ( )
virtual

Obtain the list of all folders contained in the wallet.

Returns
Returns an empty list if the wallet is not open.

Definition at line 727 of file kwallet.cpp.

void KWallet::Wallet::folderListUpdated ( )
signal

Emitted when the folder list is changed in this wallet.

void KWallet::Wallet::folderRemoved ( const QString &  folder)
signal

Emitted when a folder in this wallet is removed.

Parameters
folderThe folder that was removed.
void KWallet::Wallet::folderUpdated ( const QString &  folder)
signal

Emitted when a folder in this wallet is updated.

Parameters
folderThe folder that was updated.
const QString Wallet::FormDataFolder ( )
static

The standardized name of the form data folder.

It is automatically created when a wallet is created, but the user may still delete it so you should check for its existence and recreate it if necessary and desired.

Definition at line 142 of file kwallet.cpp.

bool Wallet::hasEntry ( const QString &  key)
virtual

Determine if the current folder has they entry key.

Parameters
keyThe key to search for.
Returns
Returns true if the folder contains key.

Definition at line 1413 of file kwallet.cpp.

bool Wallet::hasFolder ( const QString &  f)
virtual

Determine if the folder f exists in the wallet.

Parameters
fthe name of the folder to check for
Returns
Returns true if the folder exists in the wallet.

Definition at line 820 of file kwallet.cpp.

bool Wallet::isEnabled ( )
static

Determine if the KDE wallet is enabled.

Normally you do not need to use this because openWallet() will just fail.

Returns
Returns true if the wallet enabled, else false.

Definition at line 352 of file kwallet.cpp.

bool Wallet::isOpen ( const QString &  name)
static

Determine if the wallet name is open by any application.

Parameters
nameThe name of the wallet to check.
Returns
Returns true if the wallet is open, else false.

Definition at line 374 of file kwallet.cpp.

bool Wallet::isOpen ( ) const
virtual

Determine if the current wallet is open, and is a valid wallet handle.

Returns
Returns true if the wallet handle is valid and open.

Definition at line 666 of file kwallet.cpp.

bool KWallet::Wallet::isUsingKSecretsService ( )
static

Determine if the KWallet API is using the KSecretsService infrastructure This can ben changed in system settings.

Returns
Returns true if the KSecretsService infrastructure is active

Definition at line 104 of file kwallet.cpp.

bool Wallet::keyDoesNotExist ( const QString &  wallet,
const QString &  folder,
const QString &  key 
)
static

Determine if an entry in a folder does not exist in a wallet.

This does not require decryption of the wallet. This is a handy optimization to avoid prompting the user if your data is certainly not in the wallet.

Parameters
walletThe wallet to look in.
folderThe folder to look in.
keyThe key to look up.
Returns
Returns true if the key does NOT exist in the wallet, or the folder or wallet does not exist.

Definition at line 1632 of file kwallet.cpp.

const QString Wallet::LocalWallet ( )
static

The name of the wallet used to store local passwords.

Definition at line 109 of file kwallet.cpp.

int Wallet::lockWallet ( )
virtual

This closes and locks the current wallet.

It will disconnect all applications using the wallet.

Returns
Returns 0 on success, non-zero on error.

Definition at line 624 of file kwallet.cpp.

const QString Wallet::NetworkWallet ( )
static

The name of the wallet used to store network passwords.

Definition at line 127 of file kwallet.cpp.

Wallet * Wallet::openWallet ( const QString &  name,
WId  w,
OpenType  ot = Synchronous 
)
static

Open the wallet name.

The user will be prompted to allow your application to open the wallet, and may be prompted for a password. You are responsible for deleting this object when you are done with it.

Parameters
nameThe name of the wallet to open.
otIf Asynchronous, the call will return immediately with a non-null pointer to an invalid wallet. You must immediately connect the walletOpened() signal to a slot so that you will know when it is opened, or when it fails.
wThe window id to associate any dialogs with. You can pass 0 if you don't have a window the password dialog should associate with.
Returns
Returns a pointer to the wallet if successful, or a null pointer on error or if rejected.

Definition at line 452 of file kwallet.cpp.

const QString Wallet::PasswordFolder ( )
static

The standardized name of the password folder.

It is automatically created when a wallet is created, but the user may still delete it so you should check for its existence and recreate it if necessary and desired.

Definition at line 138 of file kwallet.cpp.

int Wallet::readEntry ( const QString &  key,
QByteArray &  value 
)
virtual

Read the entry key from the current folder.

The entry format is unknown except that it is either a QByteArray or a QDataStream, which effectively means that it is anything.

Parameters
keyThe key of the entry to read.
valueA buffer to fill with the value.
Returns
Returns 0 on success, non-zero on error.

Definition at line 1034 of file kwallet.cpp.

int Wallet::readEntryList ( const QString &  key,
QMap< QString, QByteArray > &  value 
)

Read the entries matching key from the current folder.

The entry format is unknown except that it is either a QByteArray or a QDataStream, which effectively means that it is anything.

Parameters
keyThe key of the entry to read. Wildcards are supported.
valueA buffer to fill with the value. The key in the map is the entry key.
Returns
Returns 0 on success, non-zero on error.

Definition at line 1078 of file kwallet.cpp.

int Wallet::readMap ( const QString &  key,
QMap< QString, QString > &  value 
)
virtual

Read the map entry key from the current folder.

Parameters
keyThe key of the entry to read.
valueA map buffer to fill with the value.
Returns
Returns 0 on success, non-zero on error. Will return an error if the key was not originally written as a map.

Definition at line 1146 of file kwallet.cpp.

int Wallet::readMapList ( const QString &  key,
QMap< QString, QMap< QString, QString > > &  value 
)

Read the map entry key from the current folder.

Parameters
keyThe key of the entry to read. Wildcards are supported.
valueA buffer to fill with the value. The key in the map is the entry key.
Returns
Returns 0 on success, non-zero on error. Will return an error if the key was not originally written as a map.

Definition at line 1198 of file kwallet.cpp.

int Wallet::readPassword ( const QString &  key,
QString &  value 
)
virtual

Read the password entry key from the current folder.

Parameters
keyThe key of the entry to read.
valueA password buffer to fill with the value.
Returns
Returns 0 on success, non-zero on error. Will return an error if the key was not originally written as a password.

Definition at line 1236 of file kwallet.cpp.

int Wallet::readPasswordList ( const QString &  key,
QMap< QString, QString > &  value 
)

Read the password entry key from the current folder.

Parameters
keyThe key of the entry to read. Wildcards are supported.
valueA buffer to fill with the value. The key in the map is the entry key.
Returns
Returns 0 on success, non-zero on error. Will return an error if the key was not originally written as a password.

Definition at line 1277 of file kwallet.cpp.

int Wallet::removeEntry ( const QString &  key)
virtual

Remove the entry key from the current folder.

Parameters
keyThe key to remove.
Returns
Returns 0 on success, non-zero on error.

Definition at line 1439 of file kwallet.cpp.

bool Wallet::removeFolder ( const QString &  f)
virtual

Remove the folder f and all its entries from the wallet.

Parameters
fthe name of the folder to remove
Returns
Returns true if the folder was successfully removed.

Definition at line 917 of file kwallet.cpp.

int Wallet::renameEntry ( const QString &  oldName,
const QString &  newName 
)
virtual

Rename the entry oldName to newName.

Parameters
oldNameThe original key of the entry.
newNameThe new key of the entry.
Returns
Returns 0 on success, non-zero on error.

Definition at line 1111 of file kwallet.cpp.

void Wallet::requestChangePassword ( WId  w)
virtual

Request to the wallet service to change the password of the current wallet.

Parameters
wThe window id to associate any dialogs with. You can pass 0 if you don't have a window the password dialog should associate with.

Definition at line 680 of file kwallet.cpp.

bool Wallet::setFolder ( const QString &  f)
virtual

Set the current working folder to f.

The folder must exist, or this call will fail. Create a folder with createFolder().

Parameters
fthe name of the folder to make the working folder
Returns
Returns true if the folder was successfully set.

Definition at line 882 of file kwallet.cpp.

int Wallet::sync ( )
virtual

This syncs the wallet file on disk with what is in memory.

You don't normally need to use this. It happens automatically on close.

Returns
Returns 0 on success, non-zero on error.

Definition at line 605 of file kwallet.cpp.

QStringList Wallet::users ( const QString &  wallet)
static

List the applications that are using the wallet wallet.

Parameters
walletThe wallet to query.
Returns
Returns a list of all DCOP application IDs using the wallet.

Definition at line 583 of file kwallet.cpp.

void Wallet::virtual_hook ( int  id,
void *  data 
)
protectedvirtual

Definition at line 1658 of file kwallet.cpp.

void KWallet::Wallet::walletClosed ( )
signal

Emitted when this wallet is closed.

QStringList Wallet::walletList ( )
static

List all the wallets available.

Returns
Returns a list of the names of all wallets that are open.

Definition at line 299 of file kwallet.cpp.

const QString & Wallet::walletName ( ) const
virtual

The name of the current wallet.

Definition at line 661 of file kwallet.cpp.

void KWallet::Wallet::walletOpened ( bool  success)
signal

Emitted when a wallet is opened in asynchronous mode.

Parameters
successTrue if the wallet was opened successfully.
int Wallet::writeEntry ( const QString &  key,
const QByteArray &  value,
EntryType  entryType 
)
virtual

Write key = value as a binary entry to the current folder.

Be careful with this, it could cause inconsistency in the future since you can put an arbitrary entry type in place.

Parameters
keyThe key of the new entry.
valueThe value of the entry.
entryTypeThe type of the entry.
Returns
Returns 0 on success, non-zero on error.

Definition at line 1308 of file kwallet.cpp.

int Wallet::writeEntry ( const QString &  key,
const QByteArray &  value 
)
virtual

Write key = value as a binary entry to the current folder.

Parameters
keyThe key of the new entry.
valueThe value of the entry.
Returns
Returns 0 on success, non-zero on error.

Definition at line 1333 of file kwallet.cpp.

int Wallet::writeMap ( const QString &  key,
const QMap< QString, QString > &  value 
)
virtual

Write key = value as a map to the current folder.

Parameters
keyThe key of the new entry.
valueThe value of the map.
Returns
Returns 0 on success, non-zero on error.

Definition at line 1358 of file kwallet.cpp.

int Wallet::writePassword ( const QString &  key,
const QString &  value 
)
virtual

Write key = value as a password to the current folder.

Parameters
keyThe key of the new entry.
valueThe value of the password.
Returns
Returns 0 on success, non-zero on error.

Definition at line 1388 of file kwallet.cpp.


The documentation for this class was generated from the following files:
  • kwallet.h
  • kwallet.cpp
  • kwallet_mac.cpp
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:24:04 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KDEUI

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

kdelibs API Reference

Skip menu "kdelibs API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal