authinfo.h
/*
* This file is part of the KDE libraries
* Copyright (C) 2000-2001 Dawit Alemayehu <adawit@kde.org>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public License
* along with this library; see the file COPYING.LIB. If not, write to
* the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
#ifndef __KIO_AUTHINFO_H
#define __KIO_AUTHINFO_H
#include <qmap.h>
#include <qvaluelist.h>
#include <kurl.h>
namespace KIO {
class KIO_EXPORT AuthInfo
{
KIO_EXPORT friend QDataStream& operator<< (QDataStream& s, const AuthInfo& a);
KIO_EXPORT friend QDataStream& operator>> (QDataStream& s, AuthInfo& a);
public:
AuthInfo();
AuthInfo( const AuthInfo& info );
AuthInfo& operator=( const AuthInfo& info );
bool isModified() const { return modified; }
void setModified( bool flag ) { modified = flag; }
KURL url;
QString username;
QString password;
QString prompt;
QString caption;
QString comment;
QString commentLabel;
QString realmValue;
QString digestInfo;
bool verifyPath;
bool readOnly;
bool keepPassword;
protected:
bool modified;
private:
class AuthInfoPrivate* d;
};
KIO_EXPORT QDataStream& operator<< (QDataStream& s, const AuthInfo& a);
KIO_EXPORT QDataStream& operator>> (QDataStream& s, AuthInfo& a);
class KIO_EXPORT NetRC
{
public:
enum LookUpMode
{
exactOnly = 0x0002,
defaultOnly = 0x0004,
presetOnly = 0x0008
};
struct AutoLogin
{
QString type;
QString machine;
QString login;
QString password;
QMap<QString, QStringList> macdef;
};
static NetRC* self();
bool lookup( const KURL& url, AutoLogin& login,
bool userealnetrc = false,
QString type = QString::null,
int mode = (exactOnly|defaultOnly) );
void reload() { isDirty = true; }
protected:
QString extract( const char*, const char*, int& );
int openf( const QString& );
bool parse( int );
private:
NetRC();
~NetRC();
private:
bool isDirty;
typedef QValueList<AutoLogin> LoginList;
typedef QMap<QString, LoginList> LoginMap;
LoginMap loginMap;
static NetRC* instance;
class NetRCPrivate;
NetRCPrivate* d;
};
}
#endif
KIO::AuthInfo::comment
QString comment
Additional comment to be displayed when prompting the user for authentication information.
Definition: authinfo.h:150
KIO::AuthInfo::keepPassword
bool keepPassword
Flag to indicate the persistence of the given password.
Definition: authinfo.h:220
KIO::AuthInfo::digestInfo
QString digestInfo
Field to store any extra authentication information for protocols that need it (ex: http)...
Definition: authinfo.h:187
KIO::AuthInfo
This class is intended to make it easier to prompt for, cache and retrieve authorization information...
Definition: authinfo.h:51
KIO::AuthInfo::readOnly
bool readOnly
Flag which if set forces the username field to be read-only.
Definition: authinfo.h:207
KIO::AuthInfo::isModified
bool isModified() const
Use this method to check if the object was modified.
Definition: authinfo.h:76
KIO::AuthInfo::url
KURL url
The URL for which authentication is to be stored.
Definition: authinfo.h:94
KIO::AuthInfo::realmValue
QString realmValue
A unique identifier that allows caching of multiple passwords for different resources in the same ser...
Definition: authinfo.h:177
KIO::AuthInfo::verifyPath
bool verifyPath
Flag that, if set, indicates whether a path match should be performed when requesting for cached auth...
Definition: authinfo.h:200
KIO::AuthInfo::setModified
void setModified(bool flag)
Use this method to indicate that this object has been modified.
Definition: authinfo.h:82
KIO::NetRC::reload
void reload()
Reloads the auto login information.
Definition: authinfo.h:297
KIO::NetRC
A Singleton class that provides access to passwords stored in .netrc files for automatic login purpos...
Definition: authinfo.h:240
KIO::AuthInfo::password
QString password
This is required for caching.
Definition: authinfo.h:104
KIO::NetRC::LookUpMode
LookUpMode
Specifies the mode to be used when searching for a matching automatic login info for a given site : ...
Definition: authinfo.h:254
KIO::AuthInfo::username
QString username
This is required for caching.
Definition: authinfo.h:99
KIO::AuthInfo::caption
QString caption
The text to displayed in the title bar of the password prompting dialog.
Definition: authinfo.h:126
KIO::AuthInfo::commentLabel
QString commentLabel
Descriptive label to be displayed in front of the comment when prompting the user for password...
Definition: authinfo.h:159
KIO::AuthInfo::prompt
QString prompt
Information to be displayed when prompting the user for authentication information.
Definition: authinfo.h:115
KIO::NetRC::AutoLogin
Contains auto login information.
Definition: authinfo.h:265

KDE Home | KDE Accessibility Home | Description of Access Keys