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

KDEUI

kwallet.h
Go to the documentation of this file.
00001 /* This file is part of the KDE project
00002  *
00003  * Copyright (C) 2002-2004 George Staikos <staikos@kde.org>
00004  *
00005  * This library is free software; you can redistribute it and/or
00006  * modify it under the terms of the GNU Library General Public
00007  * License as published by the Free Software Foundation; either
00008  * version 2 of the License, or (at your option) any later version.
00009  *
00010  * This library is distributed in the hope that it will be useful,
00011  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013  * Library General Public License for more details.
00014  *
00015  * You should have received a copy of the GNU Library General Public License
00016  * along with this library; see the file COPYING.LIB.  If not, write to
00017  * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00018  * Boston, MA 02110-1301, USA.
00019  */
00020 
00021 
00022 #ifndef _KWALLET_H
00023 #define _KWALLET_H
00024 
00025 #include <QtCore/QStringList>
00026 #include <QtCore/QObject>
00027 #include <QtGui/qwindowdefs.h> // krazy:exclude=includes (for WId)
00028 
00029 #include <kdeui_export.h>
00030 
00046 #define KSS_ATTR_ENTRYFOLDER "kwallet.folderName"
00047 #define KSS_ATTR_WALLETTYPE "kwallet.type"
00048 
00049 class QDBusError;
00050 
00051 namespace KWallet {
00052 
00062 class KDEUI_EXPORT Wallet : public QObject
00063 {
00064     Q_OBJECT
00065     protected:
00072         Wallet(int handle, const QString& name);
00077         Wallet(const Wallet&);
00078 
00079     public:
00080         enum EntryType { Unknown=0, Password, Stream, Map, Unused=0xffff };
00081 
00085         virtual ~Wallet();
00086 
00092         static QStringList walletList();
00093 
00099         static bool isEnabled();
00100 
00106         static bool isOpen(const QString& name);
00107 
00117         static int closeWallet(const QString& name, bool force);
00118 
00125         static int deleteWallet(const QString& name);
00126 
00133         static bool disconnectApplication(const QString& wallet, const QString& app);
00134 
00135         enum OpenType { Synchronous=0, Asynchronous, Path, OpenTypeUnused=0xff };
00136 
00155         static Wallet* openWallet(const QString& name, WId w, OpenType ot = Synchronous);
00156 
00163         static QStringList users(const QString& wallet);
00164 
00168         static const QString LocalWallet();
00169 
00173         static const QString NetworkWallet();
00174 
00181         static const QString PasswordFolder();
00182 
00189         static const QString FormDataFolder();
00190 
00199         static void changePassword(const QString& name, WId w);
00200 
00207         virtual int sync();
00208 
00214         virtual int lockWallet();
00215 
00219         virtual const QString& walletName() const;
00220 
00226         virtual bool isOpen() const;
00227 
00235         virtual void requestChangePassword(WId w);
00236 
00241         virtual QStringList folderList();
00242 
00248         virtual bool hasFolder(const QString& f);
00249 
00257         virtual bool setFolder(const QString& f);
00258 
00264         virtual bool removeFolder(const QString& f);
00265 
00271         virtual bool createFolder(const QString& f);
00272 
00279         virtual const QString& currentFolder() const;
00280 
00286         virtual QStringList entryList();
00287 
00294         virtual int renameEntry(const QString& oldName, const QString& newName);
00295 
00305         virtual int readEntry(const QString& key, QByteArray& value);
00306 
00315         virtual int readMap(const QString& key, QMap<QString,QString>& value);
00316 
00325         virtual int readPassword(const QString& key, QString& value);
00326 
00338         int readEntryList(const QString& key, QMap<QString, QByteArray>& value);
00339 
00350         int readMapList(const QString& key, QMap<QString, QMap<QString, QString> >& value);
00351 
00362         int readPasswordList(const QString& key, QMap<QString, QString>& value);
00363 
00374         virtual int writeEntry(const QString& key, const QByteArray& value, EntryType entryType);
00375 
00383         virtual int writeEntry(const QString& key, const QByteArray& value);
00384 
00391         virtual int writeMap(const QString& key, const QMap<QString,QString>& value);
00392 
00399         virtual int writePassword(const QString& key, const QString& value);
00400 
00406         virtual bool hasEntry(const QString& key);
00407 
00413         virtual int removeEntry(const QString& key);
00414 
00421         virtual EntryType entryType(const QString& key);
00422 
00433         static bool folderDoesNotExist(const QString& wallet, const QString& folder);
00434 
00446         static bool keyDoesNotExist(const QString& wallet, const QString& folder,
00447                         const QString& key);
00448         
00454         static bool isUsingKSecretsService();
00455 
00456     Q_SIGNALS:
00460         void walletClosed();
00461 
00466         void folderUpdated(const QString& folder);
00467 
00471         void folderListUpdated();
00472 
00477         void folderRemoved(const QString& folder);
00478 
00483         void walletOpened(bool success);
00484 
00485     private Q_SLOTS:
00490         void slotWalletClosed(int handle);
00491 
00496         void slotFolderUpdated(const QString& wallet, const QString& folder);
00497 
00502         void slotFolderListUpdated(const QString& wallet);
00503 
00508         void slotApplicationDisconnected(const QString& wallet, const QString& application);
00509 
00516         void walletAsyncOpened(int tId, int handle);
00517 
00522         void emitWalletAsyncOpenError();
00523 
00528         void emitWalletOpened();
00529         
00534         void slotCollectionStatusChanged( int );
00539         void slotCollectionDeleted();
00540 
00541     private:
00542         class WalletPrivate;
00543         WalletPrivate* const d;
00544         Q_PRIVATE_SLOT(d, void walletServiceUnregistered())
00545 
00546     protected:
00550         virtual void virtual_hook(int id, void *data);
00551 };
00552 
00553 }
00554 
00555 #endif //_KWALLET_H
00556 
This file is part of the KDE documentation.
Documentation copyright © 1996-2012 The KDE developers.
Generated on Wed May 2 2012 17:58:00 by doxygen 1.8.0 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.8.3 API Reference

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