• Skip to content
  • Skip to link menu
KDE 4.2 API Reference
  • KDE API Reference
  • kdelibs
  • Sitemap
  • 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 
00031 
00032 class QDBusError;
00033 
00034 namespace KWallet {
00035 
00045 class KDEUI_EXPORT Wallet : public QObject
00046 {
00047     Q_OBJECT
00048     protected:
00055         Wallet(int handle, const QString& name);
00060         Wallet(const Wallet&);
00061 
00062     public:
00063         enum EntryType { Unknown=0, Password, Stream, Map, Unused=0xffff };
00064 
00068         virtual ~Wallet();
00069 
00075         static QStringList walletList();
00076 
00082         static bool isEnabled();
00083 
00089         static bool isOpen(const QString& name);
00090 
00100         static int closeWallet(const QString& name, bool force);
00101 
00108         static int deleteWallet(const QString& name);
00109 
00116         static bool disconnectApplication(const QString& wallet, const QString& app);
00117 
00118         enum OpenType { Synchronous=0, Asynchronous, Path, OpenTypeUnused=0xff };
00119 
00136         static Wallet* openWallet(const QString& name, WId w, OpenType ot = Synchronous);
00137 
00144         static QStringList users(const QString& wallet);
00145 
00149         static const QString LocalWallet();
00150 
00154         static const QString NetworkWallet();
00155 
00162         static const QString PasswordFolder();
00163 
00170         static const QString FormDataFolder();
00171 
00178         static void changePassword(const QString& name, WId w);
00179 
00186         virtual int sync();
00187 
00193         virtual int lockWallet();
00194 
00198         virtual const QString& walletName() const;
00199 
00205         virtual bool isOpen() const;
00206 
00212         virtual void requestChangePassword(WId w);
00213 
00218         virtual QStringList folderList();
00219 
00225         virtual bool hasFolder(const QString& f);
00226 
00234         virtual bool setFolder(const QString& f);
00235 
00241         virtual bool removeFolder(const QString& f);
00242 
00248         virtual bool createFolder(const QString& f);
00249 
00256         virtual const QString& currentFolder() const;
00257 
00263         virtual QStringList entryList();
00264 
00271         virtual int renameEntry(const QString& oldName, const QString& newName);
00272 
00282         virtual int readEntry(const QString& key, QByteArray& value);
00283 
00292         virtual int readMap(const QString& key, QMap<QString,QString>& value);
00293 
00302         virtual int readPassword(const QString& key, QString& value);
00303 
00315         int readEntryList(const QString& key, QMap<QString, QByteArray>& value);
00316 
00327         int readMapList(const QString& key, QMap<QString, QMap<QString, QString> >& value);
00328 
00339         int readPasswordList(const QString& key, QMap<QString, QString>& value);
00340 
00351         virtual int writeEntry(const QString& key, const QByteArray& value, EntryType entryType);
00352 
00360         virtual int writeEntry(const QString& key, const QByteArray& value);
00361 
00368         virtual int writeMap(const QString& key, const QMap<QString,QString>& value);
00369 
00376         virtual int writePassword(const QString& key, const QString& value);
00377 
00383         virtual bool hasEntry(const QString& key);
00384 
00390         virtual int removeEntry(const QString& key);
00391 
00398         virtual EntryType entryType(const QString& key);
00399 
00410         static bool folderDoesNotExist(const QString& wallet, const QString& folder);
00411 
00423         static bool keyDoesNotExist(const QString& wallet, const QString& folder,
00424                         const QString& key);
00425 
00426     Q_SIGNALS:
00430         void walletClosed();
00431 
00436         void folderUpdated(const QString& folder);
00437 
00441         void folderListUpdated();
00442 
00447         void folderRemoved(const QString& folder);
00448 
00453         void walletOpened(bool success);
00454 
00455     private Q_SLOTS:
00460         void slotWalletClosed(int handle);
00461 
00466         void slotFolderUpdated(const QString& wallet, const QString& folder);
00467 
00472         void slotFolderListUpdated(const QString& wallet);
00473 
00478         void slotApplicationDisconnected(const QString& wallet, const QString& application);
00479 
00486         void walletAsyncOpened(int tId, int handle);
00487 
00492         void emitWalletAsyncOpenError();
00493 
00498         void slotServiceOwnerChanged(const QString&,const QString&,const QString&);
00499 
00500     private:
00501         class WalletPrivate;
00502         WalletPrivate* const d;
00503 
00504     protected:
00508         virtual void virtual_hook(int id, void *data);
00509 };
00510 
00511 }
00512 
00513 #endif //_KWALLET_H
00514 

KDEUI

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

kdelibs

Skip menu "kdelibs"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • Kate
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • Kross
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Generated for kdelibs by doxygen 1.5.7
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal