# class Wallet

###

Module | kdeui
Namespace | KWallet
Class | Wallet
Inherits | QObject

KDE Wallet

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

Author George Staikos <staikos@kde.org> KDE Wallet Class

### enums

- EntryType { Unknown, Password, Stream, Map, Unused }
- OpenType { Synchronous, Asynchronous, Path, OpenTypeUnused }

enum details

### methods

- FormDataFolder ( )

  returns QString
  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.

- LocalWallet ( )

  returns QString
  static

  The name of the wallet used to store local passwords.

- NetworkWallet ( )

  returns QString
  static

  The name of the wallet used to store network passwords.

- PasswordFolder ( )

  returns QString
  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.

- Wallet (handle, name)

  returns ctor

  Argument | Type | Default
  --- | --- | ---
  handle | int |
  name | QString |

  Construct a KWallet object. Internal

  handle - The handle for the wallet.

  name - The name of the wallet.

- Wallet (a0)

  returns ctor
  Not implemented

  Argument | Type | Default
  --- | --- | ---
  a0 | KWallet.Wallet |

  Copy a KWallet object. Internal

- changePassword (name, w)

  returns Nothing
  static

  Argument | Type | Default
  --- | --- | ---
  name | QString |
  w | WId |

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

  name - The the wallet to change the password of.

  w - The window id to associate any dialogs with.

- closeWallet (name, force)

  returns int
  static

  Argument | Type | Default
  --- | --- | ---
  name | QString |
  force | bool |

  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.

  name - The name of the wallet to close.

  force - Set true to force the wallet closed even if it is in use by others. Returns Returns 0 on success, non-zero on error.

- createFolder (f)

  returns bool

  Argument | Type | Default
  --- | --- | ---
  f | QString |

  Created the folder f.

  f - the name of the folder to create Returns Returns true if the folder was successfully created.

- currentFolder ( )

  returns QString

  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.

- deleteWallet (name)

  returns int
  static

  Argument | Type | Default
  --- | --- | ---
  name | QString |

  Delete the wallet name. The wallet will be forced closed first.

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

- disconnectApplication (wallet, app)

  returns bool
  static

  Argument | Type | Default
  --- | --- | ---
  wallet | QString |
  app | QString |

  Disconnect the application app from wallet.

  wallet - The name of the wallet to disconnect.

  app - The name of the application to disconnect. Returns Returns true on success, false on error.

- entryList ( )

  returns QStringList

  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.

- entryType (key)

  returns KWallet::Wallet.EntryType

  Argument | Type | Default
  --- | --- | ---
  key | QString |

  Determine the type of the entry key in this folder.

  key - The key to look up. Returns Returns an enumerated type representing the type of the entry.

- folderDoesNotExist (wallet, folder)

  returns bool
  static

  Argument | Type | Default
  --- | --- | ---
  wallet | QString |
  folder | QString |

  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.

  wallet - The wallet to look in.

  folder - The folder to look up. Returns Returns true if the folder does NOT exist in the wallet, or the wallet does not exist.

- folderList ( )

  returns QStringList

  Obtain the list of all folders contained in the wallet. Returns Returns an empty list if the wallet is not open.

- folderListUpdated ( )

  returns Nothing
  SIGNAL ("folderListUpdated ()")

  Emitted when the folder list is changed in this wallet.

- folderRemoved (folder)

  returns Nothing
  SIGNAL ("folderRemoved (const QString&)")

  Argument | Type | Default
  --- | --- | ---
  folder | QString |

  Emitted when a folder in this wallet is removed.

  folder - The folder that was removed.

- folderUpdated (folder)

  returns Nothing
  SIGNAL ("folderUpdated (const QString&)")

  Argument | Type | Default
  --- | --- | ---
  folder | QString |

  Emitted when a folder in this wallet is updated.

  folder - The folder that was updated.

- hasEntry (key)

  returns bool

  Argument | Type | Default
  --- | --- | ---
  key | QString |

  Determine if the current folder has they entry key.

  key - The key to search for. Returns Returns true if the folder contains key.

- hasFolder (f)

  returns bool

  Argument | Type | Default
  --- | --- | ---
  f | QString |

  Determine if the folder f exists in the wallet.

  f - the name of the folder to check for Returns Returns true if the folder exists in the wallet.

- isEnabled ( )

  returns bool
  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.

- isOpen (name)

  returns bool
  static

  Argument | Type | Default
  --- | --- | ---
  name | QString |

  Determine if the wallet name is open by any application.

  name - The name of the wallet to check. Returns Returns true if the wallet is open, else false.

- isOpen ( )

  returns bool

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

- keyDoesNotExist (wallet, folder, key)

  returns bool
  static

  Argument | Type | Default
  --- | --- | ---
  wallet | QString |
  folder | QString |
  key | QString |

  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.

  wallet - The wallet to look in.

  folder - The folder to look in.

  key - The key to look up. Returns Returns true if the key does NOT exist in the wallet, or the folder or wallet does not exist.

- lockWallet ( )

  returns int

  This closes and locks the current wallet. It will disconnect all applications using the wallet. Returns Returns 0 on success, non-zero on error.

- openWallet (name, w, ot)

  returns KWallet.Wallet
  static

  Argument | Type | Default
  --- | --- | ---
  name | QString |
  w | WId |
  ot | KWallet::Wallet.OpenType | KWallet.Wallet.Synchronous

  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.

  name - The name of the wallet to open.

  ot - If 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.

  w - The window id to associate any dialogs with. Returns Returns a pointer to the wallet if successful, or a null pointer on error or if rejected.

- readEntry (key, value)

  returns int

  Argument | Type | Default
  --- | --- | ---
  key | QString |
  value | QByteArray |

  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.

  key - The key of the entry to read.

  value - A buffer to fill with the value. Returns Returns 0 on success, non-zero on error.

- readEntryList (key, value)

  returns int

  Argument | Type | Default
  --- | --- | ---
  key | QString |
  value | QMap<QString,QByteArray> |

  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.

  key - The key of the entry to read. Wildcards are supported.

  value - A buffer to fill with the value. The key in the map is the entry key. Returns Returns 0 on success, non-zero on error.

- readMap (key, value)

  returns int

  Argument | Type | Default
  --- | --- | ---
  key | QString |
  value | QMap<QString,QString> |

  Read the map entry key from the current folder.

  key - The key of the entry to read.

  value - A 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.

- readMapList (key, value)

  returns int
  Not implemented

  Argument | Type | Default
  --- | --- | ---
  key | QString |
  value | QMap<QString,QMap<QString,QString>> |

  Read the map entry key from the current folder.

  key - The key of the entry to read. Wildcards are supported.

  value - A 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.

- readPassword (key, value)

  returns int

  Argument | Type | Default
  --- | --- | ---
  key | QString |
  value | QString |

  Read the password entry key from the current folder.

  key - The key of the entry to read.

  value - A 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.

- readPasswordList (key, value)

  returns int

  Argument | Type | Default
  --- | --- | ---
  key | QString |
  value | QMap<QString,QString> |

  Read the password entry key from the current folder.

  key - The key of the entry to read. Wildcards are supported.

  value - A 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.

- removeEntry (key)

  returns int

  Argument | Type | Default
  --- | --- | ---
  key | QString |

  Remove the entry key from the current folder.

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

- removeFolder (f)

  returns bool

  Argument | Type | Default
  --- | --- | ---
  f | QString |

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

  f - the name of the folder to remove Returns Returns true if the folder was successfully removed.

- renameEntry (oldName, newName)

  returns int

  Argument | Type | Default
  --- | --- | ---
  oldName | QString |
  newName | QString |

  Rename the entry oldName to newName.

  oldName - The original key of the entry.

  newName - The new key of the entry. Returns Returns 0 on success, non-zero on error.

- requestChangePassword (w)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  w | WId |

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

  w - The window id to associate any dialogs with.

- setFolder (f)

  returns bool

  Argument | Type | Default
  --- | --- | ---
  f | QString |

  Set the current working folder to f. The folder must exist, or this call will fail. Create a folder with createFolder().

  f - the name of the folder to make the working folder Returns Returns true if the folder was successfully set.

- sync ( )

  returns int

  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.

- users (wallet)

  returns QStringList
  static

  Argument | Type | Default
  --- | --- | ---
  wallet | QString |

  List the applications that are using the wallet wallet.

  wallet - The wallet to query. Returns Returns a list of all DCOP application IDs using the wallet.

- virtual_hook (id, data)

  returns Nothing
  Not implemented

  Argument | Type | Default
  --- | --- | ---
  id | int |
  data | void |

  Internal

- walletClosed ( )

  returns Nothing
  SIGNAL ("walletClosed ()")

  Emitted when this wallet is closed.

- walletList ( )

  returns QStringList
  static

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

- walletName ( )

  returns QString

  The name of the current wallet.

- walletOpened (success)

  returns Nothing
  SIGNAL ("walletOpened (bool)")

  Argument | Type | Default
  --- | --- | ---
  success | bool |

  Emitted when a wallet is opened in asynchronous mode.

  success - True if the wallet was opened successfully.

- writeEntry (key, value, entryType)

  returns int

  Argument | Type | Default
  --- | --- | ---
  key | QString |
  value | QByteArray |
  entryType | KWallet::Wallet.EntryType |

  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.

  key - The key of the new entry.

  value - The value of the entry.

  entryType - The type of the entry. Returns Returns 0 on success, non-zero on error.

- writeEntry (key, value)

  returns int

  Argument | Type | Default
  --- | --- | ---
  key | QString |
  value | QByteArray |

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

  key - The key of the new entry.

  value - The value of the entry. Returns Returns 0 on success, non-zero on error.

- writeMap (key, value)

  returns int

  Argument | Type | Default
  --- | --- | ---
  key | QString |
  value | QMap<QString,QString> |

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

  key - The key of the new entry.

  value - The value of the map. Returns Returns 0 on success, non-zero on error.

- writePassword (key, value)

  returns int

  Argument | Type | Default
  --- | --- | ---
  key | QString |
  value | QString |

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

  key - The key of the new entry.

  value - The value of the password. Returns Returns 0 on success, non-zero on error.

### enums - detail

- EntryType { Unknown, Password, Stream, Map, Unused }

  | Unknown | - 0 | - |
  | Password | - | - |
  | Stream | - | - |
  | Map | - | - |
  | Unused | - 0xffff | - |

- OpenType { Synchronous, Asynchronous, Path, OpenTypeUnused }

  | Synchronous | - 0 | - |
  | Asynchronous | - | - |
  | Path | - | - |
  | OpenTypeUnused | - 0xff | - |