• Skip to content
  • Skip to link menu
KDE 3.5 API Reference
  • KDE API Reference
  • API Reference
  • Sitemap
  • Contact Us
 

kio

kwalletd.h

Go to the documentation of this file.
00001 /*
00002    This file is part of the KDE libraries
00003 
00004    Copyright (c) 2002-2004 George Staikos <staikos@kde.org>
00005 
00006    This library is free software; you can redistribute it and/or
00007    modify it under the terms of the GNU Library General Public
00008    License as published by the Free Software Foundation; either
00009    version 2 of the License, or (at your option) any later version.
00010 
00011    This library is distributed in the hope that it will be useful,
00012    but WITHOUT ANY WARRANTY; without even the implied warranty of
00013    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014    Library General Public License for more details.
00015 
00016    You should have received a copy of the GNU Library General Public License
00017    along with this library; see the file COPYING.LIB.  If not, write to
00018    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00019    Boston, MA 02110-1301, USA.
00020 
00021 */
00022 #ifndef _KWALLETD_H_
00023 #define _KWALLETD_H_
00024 
00025 #include <kded/kdedmodule.h>
00026 #include <qintdict.h>
00027 #include <qstring.h>
00028 #include <qwidget.h>
00029 #include <qguardedptr.h>
00030 #include "kwalletbackend.h"
00031 
00032 #include <time.h>
00033 #include <stdlib.h>
00034 
00035 class KDirWatch;
00036 class KTimeout;
00037 
00038 // @Private
00039 class KWalletTransaction;
00040 
00041 class KWalletD : public KDEDModule {
00042     Q_OBJECT
00043     K_DCOP
00044     public:
00045         KWalletD(const QCString &name);
00046         virtual ~KWalletD();
00047 
00048     k_dcop:
00049         // Is the wallet enabled?  If not, all open() calls fail.
00050         virtual bool isEnabled() const;
00051 
00052         // Open and unlock the wallet
00053         virtual int open(const QString& wallet, uint wId);
00054 
00055         // Open and unlock the wallet with this path
00056         virtual int openPath(const QString& path, uint wId);
00057 
00058         // Asynchronous open - must give the object to return the handle
00059         // to.
00060         virtual void openAsynchronous(const QString& wallet, const QCString& returnObject, uint wId);
00061 
00062         // Close and lock the wallet
00063         // If force = true, will close it for all users.  Behave.  This
00064         // can break applications, and is generally intended for use by
00065         // the wallet manager app only.
00066         virtual int close(const QString& wallet, bool force);
00067         virtual int close(int handle, bool force);
00068 
00069         // Save to disk but leave open
00070         virtual ASYNC sync(int handle);
00071 
00072         // Physically deletes the wallet from disk.
00073         virtual int deleteWallet(const QString& wallet);
00074 
00075         // Returns true if the wallet is open
00076         virtual bool isOpen(const QString& wallet) const;
00077         virtual bool isOpen(int handle);
00078 
00079         // List the users of this wallet
00080         virtual QStringList users(const QString& wallet) const;
00081 
00082         // Change the password of this wallet
00083         virtual void changePassword(const QString& wallet, uint wId);
00084 
00085         // A list of all wallets
00086         virtual QStringList wallets() const;
00087 
00088         // A list of all folders in this wallet
00089         virtual QStringList folderList(int handle);
00090 
00091         // Does this wallet have this folder?
00092         virtual bool hasFolder(int handle, const QString& folder);
00093 
00094         // Create this folder
00095         virtual bool createFolder(int handle, const QString& folder);
00096 
00097         // Remove this folder
00098         virtual bool removeFolder(int handle, const QString& folder);
00099 
00100         // List of entries in this folder
00101         virtual QStringList entryList(int handle, const QString& folder);
00102 
00103         // Read an entry.  If the entry does not exist, it just
00104         // returns an empty result.  It is your responsibility to check
00105         // hasEntry() first.
00106         virtual QByteArray readEntry(int handle, const QString& folder, const QString& key);
00107         virtual QByteArray readMap(int handle, const QString& folder, const QString& key);
00108         virtual QString readPassword(int handle, const QString& folder, const QString& key);
00109         virtual QMap<QString, QByteArray> readEntryList(int handle, const QString& folder, const QString& key);
00110         virtual QMap<QString, QByteArray> readMapList(int handle, const QString& folder, const QString& key);
00111         virtual QMap<QString, QString> readPasswordList(int handle, const QString& folder, const QString& key);
00112 
00113         // Rename an entry.  rc=0 on success.
00114         virtual int renameEntry(int handle, const QString& folder, const QString& oldName, const QString& newName);
00115 
00116         // Write an entry.  rc=0 on success.
00117         virtual int writeEntry(int handle, const QString& folder, const QString& key, const QByteArray& value, int entryType);
00118         virtual int writeEntry(int handle, const QString& folder, const QString& key, const QByteArray& value);
00119         virtual int writeMap(int handle, const QString& folder, const QString& key, const QByteArray& value);
00120         virtual int writePassword(int handle, const QString& folder, const QString& key, const QString& value);
00121 
00122         // Does the entry exist?
00123         virtual bool hasEntry(int handle, const QString& folder, const QString& key);
00124 
00125         // What type is the entry?
00126         virtual int entryType(int handle, const QString& folder, const QString& key);
00127 
00128         // Remove an entry.  rc=0 on success.
00129         virtual int removeEntry(int handle, const QString& folder, const QString& key);
00130 
00131         // Disconnect an app from a wallet
00132         virtual bool disconnectApplication(const QString& wallet, const QCString& application);
00133 
00134         virtual void reconfigure();
00135 
00136         // Determine
00137         virtual bool folderDoesNotExist(const QString& wallet, const QString& folder);
00138         virtual bool keyDoesNotExist(const QString& wallet, const QString& folder, const QString& key);
00139 
00140         virtual void closeAllWallets();
00141 
00142         virtual QString networkWallet();
00143 
00144         virtual QString localWallet();
00145 
00146     private slots:
00147         void slotAppUnregistered(const QCString& app);
00148         void emitWalletListDirty();
00149         void timedOut(int);
00150         void notifyFailures();
00151         void processTransactions();
00152 
00153     private:
00154         int internalOpen(const QCString& appid, const QString& wallet, bool isPath = false, WId w = 0, bool modal = false);
00155         bool isAuthorizedApp(const QCString& appid, const QString& wallet, WId w);
00156         // This also validates the handle.  May return NULL.
00157         KWallet::Backend* getWallet(const QCString& appid, int handle);
00158         // Generate a new unique handle.
00159         int generateHandle();
00160         // Invalidate a handle (remove it from the QMap)
00161         void invalidateHandle(int handle);
00162         // Emit signals about closing wallets
00163         void doCloseSignals(int,const QString&);
00164         void emitFolderUpdated(const QString&, const QString&);
00165         // Internal - close this wallet.
00166         int closeWallet(KWallet::Backend *w, int handle, bool force);
00167         // Implicitly allow access for this application
00168         bool implicitAllow(const QString& wallet, const QCString& app);
00169         bool implicitDeny(const QString& wallet, const QCString& app);
00170         QCString friendlyDCOPPeerName();
00171 
00172         void doTransactionChangePassword(const QCString& appid, const QString& wallet, uint wId);
00173         int doTransactionOpen(const QCString& appid, const QString& wallet, uint wId, bool modal);
00174 
00175         void setupDialog( QWidget* dialog, WId wId, const QCString& appid, bool modal );
00176         void checkActiveDialog();
00177 
00178         QIntDict<KWallet::Backend> _wallets;
00179         QMap<QCString,QValueList<int> > _handles;
00180         QMap<QString,QCString> _passwords;
00181         KDirWatch *_dw;
00182         int _failed;
00183 
00184         bool _leaveOpen, _closeIdle, _launchManager, _enabled;
00185             bool _openPrompt, _firstUse, _showingFailureNotify;
00186         int _idleTime;
00187         QMap<QString,QStringList> _implicitAllowMap, _implicitDenyMap;
00188         KTimeout *_timeouts;
00189 
00190         QPtrList<KWalletTransaction> _transactions;
00191         QGuardedPtr< QWidget > activeDialog;
00192 };
00193 
00194 
00195 #endif

kio

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

API Reference

Skip menu "API Reference"
  • dcop
  • DNSSD
  • interfaces
  • Kate
  • kconf_update
  • KDECore
  • KDED
  • kdefx
  • KDEsu
  • kdeui
  • KDocTools
  • KHTML
  • KImgIO
  • KInit
  • kio
  • kioslave
  • KJS
  • KNewStuff
  • KParts
  • KUtils
Generated for API Reference by doxygen 1.5.9
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