authinfo.h
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef __KIO_AUTHINFO_H
00022 #define __KIO_AUTHINFO_H
00023
00024 #include <qmap.h>
00025 #include <qvaluelist.h>
00026 #include <kurl.h>
00027
00028
00029 namespace KIO {
00030
00051 class AuthInfo
00052 {
00053 friend QDataStream& operator<< (QDataStream& s, const AuthInfo& a);
00054 friend QDataStream& operator>> (QDataStream& s, AuthInfo& a);
00055
00056 public:
00060 AuthInfo();
00061
00065 AuthInfo( const AuthInfo& info );
00066
00070 AuthInfo& operator=( const AuthInfo& info );
00071
00075 bool isModified() const { return modified; }
00076
00080 void setModified( bool flag ) { modified = flag; }
00081
00092 KURL url;
00093
00097 QString username;
00098
00102 QString password;
00103
00113 QString prompt;
00114
00124 QString caption;
00125
00148 QString comment;
00149
00157 QString commentLabel;
00158
00175 QString realmValue;
00176
00185 QString digestInfo;
00186
00198 bool verifyPath;
00199
00205 bool readOnly;
00206
00218 bool keepPassword;
00219
00220 protected:
00221 bool modified;
00222 private:
00223 class AuthInfoPrivate* d;
00224 };
00225
00226 QDataStream& operator<< (QDataStream& s, const AuthInfo& a);
00227 QDataStream& operator>> (QDataStream& s, AuthInfo& a);
00228
00237 class NetRC
00238 {
00239 public:
00240
00251 enum LookUpMode
00252 {
00253 exactOnly = 0x0002,
00254 defaultOnly = 0x0004,
00255 presetOnly = 0x0008
00256 };
00257
00261 struct AutoLogin
00262 {
00263 QString type;
00264 QString machine;
00265 QString login;
00266 QString password;
00267 QMap<QString, QStringList> macdef;
00268 };
00269
00273 static NetRC* self();
00274
00278 bool lookup( const KURL&, AutoLogin&, bool userealnetrc = false,
00279 QString type = QString::null,
00280 int mode = (exactOnly|defaultOnly) );
00284 void reload() { isDirty = true; }
00285
00286 protected:
00287 QString extract( const char*, const char*, int& );
00288 int openf( const QString& );
00289 void parse( int );
00290
00291 private:
00292 NetRC();
00293 ~NetRC();
00294
00295 private:
00296 bool isDirty;
00297
00298 typedef QValueList<AutoLogin> LoginList;
00299 typedef QMap<QString, LoginList> LoginMap;
00300 LoginMap loginMap;
00301
00302 static NetRC* instance;
00303 class NetRCPrivate;
00304 NetRCPrivate* d;
00305 };
00306 };
00307 #endif
This file is part of the documentation for kdelibs Version 3.1.0.