KIO
authinfo.h
Go to the documentation of this file.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 "kio_export.h"
00025
00026 #include <QtCore/QMap>
00027 #include <QtCore/QList>
00028 #include <QtCore/QStringList>
00029 #include <kurl.h>
00030
00031 namespace KIO {
00032
00053 class KIO_EXPORT AuthInfo
00054 {
00055 KIO_EXPORT friend QDataStream& operator<< (QDataStream& s, const AuthInfo& a);
00056 KIO_EXPORT friend QDataStream& operator>> (QDataStream& s, AuthInfo& a);
00057
00058 public:
00062 AuthInfo();
00063
00067 AuthInfo( const AuthInfo& info );
00068
00072 AuthInfo& operator=( const AuthInfo& info );
00073
00078 bool isModified() const;
00079
00084 void setModified( bool flag );
00085
00096 KUrl url;
00097
00101 QString username;
00102
00106 QString password;
00107
00117 QString prompt;
00118
00128 QString caption;
00129
00152 QString comment;
00153
00161 QString commentLabel;
00162
00179 QString realmValue;
00180
00189 QString digestInfo;
00190
00202 bool verifyPath;
00203
00209 bool readOnly;
00210
00222 bool keepPassword;
00223
00224 protected:
00225 bool modified;
00226 private:
00227 class AuthInfoPrivate* d;
00228 };
00229
00230 KIO_EXPORT QDataStream& operator<< (QDataStream& s, const AuthInfo& a);
00231 KIO_EXPORT QDataStream& operator>> (QDataStream& s, AuthInfo& a);
00232
00242 class KIO_EXPORT NetRC
00243 {
00244 public:
00245
00256 enum LookUpModeFlag
00257 {
00258 exactOnly = 0x0002,
00259 defaultOnly = 0x0004,
00260 presetOnly = 0x0008
00261 };
00262 Q_DECLARE_FLAGS(LookUpMode, LookUpModeFlag)
00263
00264
00268 struct AutoLogin
00269 {
00270 QString type;
00271 QString machine;
00272 QString login;
00273 QString password;
00274 QMap<QString, QStringList> macdef;
00275 };
00276
00281 static NetRC* self();
00282
00293 bool lookup( const KUrl& url, AutoLogin& login,
00294 bool userealnetrc = false,
00295 const QString &type = QString(),
00296 LookUpMode mode = LookUpMode(exactOnly) | defaultOnly );
00300 void reload();
00301
00302 protected:
00303 QString extract( const char*, const char*, int& );
00304 int openf( const QString& );
00305 bool parse( int );
00306
00307 private:
00308 NetRC();
00309 ~NetRC();
00310
00311 private:
00312 static NetRC* instance;
00313
00314 class NetRCPrivate;
00315 NetRCPrivate* const d;
00316 };
00317 }
00318 Q_DECLARE_OPERATORS_FOR_FLAGS(KIO::NetRC::LookUpMode)
00319
00320 #endif