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

KDEUI

  • kdeui
  • util
kwallet.h
Go to the documentation of this file.
1/* This file is part of the KDE project
2 *
3 * Copyright (C) 2002-2004 George Staikos <staikos@kde.org>
4 *
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version.
9 *
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Library General Public License for more details.
14 *
15 * You should have received a copy of the GNU Library General Public License
16 * along with this library; see the file COPYING.LIB. If not, write to
17 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 * Boston, MA 02110-1301, USA.
19 */
20
21
22#ifndef _KWALLET_H
23#define _KWALLET_H
24
25#include <QtCore/QStringList>
26#include <QtCore/QObject>
27#include <QtGui/qwindowdefs.h> // krazy:exclude=includes (for WId)
28
29#include <kdeui_export.h>
30
46#define KSS_ATTR_ENTRYFOLDER "kwallet.folderName"
47#define KSS_ATTR_WALLETTYPE "kwallet.type"
48
49class QDBusError;
50
51namespace KWallet {
52
62class KDEUI_EXPORT Wallet : public QObject
63{
64 Q_OBJECT
65 protected:
72 Wallet(int handle, const QString& name);
77 Wallet(const Wallet&);
78
79 public:
80 enum EntryType { Unknown=0, Password, Stream, Map, Unused=0xffff };
81
85 virtual ~Wallet();
86
92 static QStringList walletList();
93
99 static bool isEnabled();
100
106 static bool isOpen(const QString& name);
107
117 static int closeWallet(const QString& name, bool force);
118
125 static int deleteWallet(const QString& name);
126
133 static bool disconnectApplication(const QString& wallet, const QString& app);
134
135 enum OpenType { Synchronous=0, Asynchronous, Path, OpenTypeUnused=0xff };
136
155 static Wallet* openWallet(const QString& name, WId w, OpenType ot = Synchronous);
156
163 static QStringList users(const QString& wallet);
164
168 static const QString LocalWallet();
169
173 static const QString NetworkWallet();
174
181 static const QString PasswordFolder();
182
189 static const QString FormDataFolder();
190
199 static void changePassword(const QString& name, WId w);
200
207 virtual int sync();
208
214 virtual int lockWallet();
215
219 virtual const QString& walletName() const;
220
226 virtual bool isOpen() const;
227
235 virtual void requestChangePassword(WId w);
236
241 virtual QStringList folderList();
242
248 virtual bool hasFolder(const QString& f);
249
257 virtual bool setFolder(const QString& f);
258
264 virtual bool removeFolder(const QString& f);
265
271 virtual bool createFolder(const QString& f);
272
279 virtual const QString& currentFolder() const;
280
286 virtual QStringList entryList();
287
294 virtual int renameEntry(const QString& oldName, const QString& newName);
295
305 virtual int readEntry(const QString& key, QByteArray& value);
306
315 virtual int readMap(const QString& key, QMap<QString,QString>& value);
316
325 virtual int readPassword(const QString& key, QString& value);
326
338 int readEntryList(const QString& key, QMap<QString, QByteArray>& value);
339
350 int readMapList(const QString& key, QMap<QString, QMap<QString, QString> >& value);
351
362 int readPasswordList(const QString& key, QMap<QString, QString>& value);
363
374 virtual int writeEntry(const QString& key, const QByteArray& value, EntryType entryType);
375
383 virtual int writeEntry(const QString& key, const QByteArray& value);
384
391 virtual int writeMap(const QString& key, const QMap<QString,QString>& value);
392
399 virtual int writePassword(const QString& key, const QString& value);
400
406 virtual bool hasEntry(const QString& key);
407
413 virtual int removeEntry(const QString& key);
414
421 virtual EntryType entryType(const QString& key);
422
433 static bool folderDoesNotExist(const QString& wallet, const QString& folder);
434
446 static bool keyDoesNotExist(const QString& wallet, const QString& folder,
447 const QString& key);
448
454 static bool isUsingKSecretsService();
455
456 Q_SIGNALS:
460 void walletClosed();
461
466 void folderUpdated(const QString& folder);
467
471 void folderListUpdated();
472
477 void folderRemoved(const QString& folder);
478
483 void walletOpened(bool success);
484
485 private Q_SLOTS:
490 void slotWalletClosed(int handle);
491
496 void slotFolderUpdated(const QString& wallet, const QString& folder);
497
502 void slotFolderListUpdated(const QString& wallet);
503
508 void slotApplicationDisconnected(const QString& wallet, const QString& application);
509
516 void walletAsyncOpened(int tId, int handle);
517
522 void emitWalletAsyncOpenError();
523
528 void emitWalletOpened();
529
534 void slotCollectionStatusChanged( int );
539 void slotCollectionDeleted();
540
541 private:
542 class WalletPrivate;
543 WalletPrivate* const d;
544 Q_PRIVATE_SLOT(d, void walletServiceUnregistered())
545
546 protected:
550 virtual void virtual_hook(int id, void *data);
551};
552
553}
554
555#endif //_KWALLET_H
556
KWallet::Wallet
KDE Wallet.
Definition: kwallet.h:63
KWallet::Wallet::OpenType
OpenType
Definition: kwallet.h:135
KWallet::Wallet::Asynchronous
@ Asynchronous
Definition: kwallet.h:135
KWallet::Wallet::folderUpdated
void folderUpdated(const QString &folder)
Emitted when a folder in this wallet is updated.
KWallet::Wallet::walletClosed
void walletClosed()
Emitted when this wallet is closed.
KWallet::Wallet::folderListUpdated
void folderListUpdated()
Emitted when the folder list is changed in this wallet.
KWallet::Wallet::Wallet
Wallet(const Wallet &)
Copy a KWallet object.
KWallet::Wallet::EntryType
EntryType
Definition: kwallet.h:80
KWallet::Wallet::folderRemoved
void folderRemoved(const QString &folder)
Emitted when a folder in this wallet is removed.
KWallet::Wallet::walletOpened
void walletOpened(bool success)
Emitted when a wallet is opened in asynchronous mode.
QMap
QObject
readEntry
KAutostart::StartPhase readEntry(const KConfigGroup &group, const char *key, const KAutostart::StartPhase &aDefault)
kdeui_export.h
Unknown
Unknown
KWallet
Definition: kwallet.cpp:56
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon Feb 20 2023 00:00:00 by doxygen 1.9.6 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-4.14.38 API Reference

Skip menu "kdelibs-4.14.38 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
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