• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdelibs API Reference
  • KDE Home
  • Contact Us
 

KIO

  • sources
  • kde-4.14
  • kdelibs
  • kio
  • kio
authinfo.h
Go to the documentation of this file.
1 /*
2  * This file is part of the KDE libraries
3  * Copyright (C) 2000-2001 Dawit Alemayehu <adawit@kde.org>
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Library General Public
7  * License as published by the Free Software Foundation; either
8  * version 2 of the License, or (at your option) any later version.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  * Library General Public License for more details.
14  *
15  * You should have received a copy of the GNU Library General Public License
16  * along with this library; see the file COPYING.LIB. If not, write to
17  * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18  * Boston, MA 02110-1301, USA.
19  */
20 
21 #ifndef KIO_AUTHINFO_H
22 #define KIO_AUTHINFO_H
23 
24 #include "kio_export.h"
25 
26 #include <QtCore/QMap>
27 #include <QtCore/QList>
28 #include <QtCore/QStringList>
29 #include <kurl.h>
30 
31 class QDBusArgument;
32 
33 namespace KIO {
34 
35 class AuthInfoPrivate;
36 
57 class KIO_EXPORT AuthInfo
58 {
59  KIO_EXPORT friend QDataStream& operator<< (QDataStream& s, const AuthInfo& a);
60  KIO_EXPORT friend QDataStream& operator>> (QDataStream& s, AuthInfo& a);
61 
62  KIO_EXPORT friend QDBusArgument &operator<<(QDBusArgument &argument, const AuthInfo &a);
63  KIO_EXPORT friend const QDBusArgument &operator>>(const QDBusArgument &argument, AuthInfo &a);
64 
65 public:
66 
70  AuthInfo();
71 
75  AuthInfo( const AuthInfo& info );
76 
81  ~AuthInfo();
82 
86  AuthInfo& operator=( const AuthInfo& info );
87 
92  bool isModified() const;
93 
98  void setModified( bool flag );
99 
110  KUrl url;
111 
115  QString username;
116 
120  QString password;
121 
131  QString prompt;
132 
142  QString caption;
143 
166  QString comment;
167 
175  QString commentLabel;
176 
189  QString realmValue;
190 
199  QString digestInfo;
200 
212  bool verifyPath;
213 
219  bool readOnly;
220 
232  bool keepPassword;
233 
238  enum FieldFlags
239  {
240  ExtraFieldNoFlags = 0,
241  ExtraFieldReadOnly = 1<<1,
242  ExtraFieldMandatory = 1<<2
243  };
244 
254  void setExtraField(const QString &fieldName, const QVariant & value);
255 
260  void setExtraFieldFlags(const QString &fieldName, const FieldFlags flags);
261 
267  QVariant getExtraField(const QString &fieldName) const;
268 
273  AuthInfo::FieldFlags getExtraFieldFlags(const QString &fieldName) const;
274 
281  static void registerMetaTypes();
282 
283 protected:
284  bool modified;
285 
286 private:
287  friend class ::KIO::AuthInfoPrivate;
288  AuthInfoPrivate * const d;
289 };
290 
291 KIO_EXPORT QDataStream& operator<< (QDataStream& s, const AuthInfo& a);
292 KIO_EXPORT QDataStream& operator>> (QDataStream& s, AuthInfo& a);
293 
294 KIO_EXPORT QDBusArgument &operator<<(QDBusArgument &argument, const AuthInfo &a);
295 KIO_EXPORT const QDBusArgument &operator>>(const QDBusArgument &argument, AuthInfo &a);
296 
306 class KIO_EXPORT NetRC
307 {
308 public:
309 
320  enum LookUpModeFlag
321  {
322  exactOnly = 0x0002,
323  defaultOnly = 0x0004,
324  presetOnly = 0x0008
325  };
326  Q_DECLARE_FLAGS(LookUpMode, LookUpModeFlag)
327 
328 
332  struct AutoLogin
333  {
334  QString type;
335  QString machine;
336  QString login;
337  QString password;
338  QMap<QString, QStringList> macdef;
339  };
340 
345  static NetRC* self();
346 
357  bool lookup( const KUrl& url, AutoLogin& login,
358  bool userealnetrc = false,
359  const QString &type = QString(),
360  LookUpMode mode = LookUpMode(exactOnly) | defaultOnly );
364  void reload();
365 
366 protected:
367  QString extract( const char*, const char*, int& );
368  int openf( const QString& );
369  bool parse( int );
370 
371 private:
372  NetRC();
373  ~NetRC();
374 
375 private:
376  static NetRC* instance;
377 
378  class NetRCPrivate;
379  NetRCPrivate* const d;
380 };
381 }
382 Q_DECLARE_OPERATORS_FOR_FLAGS(KIO::NetRC::LookUpMode)
383 Q_DECLARE_METATYPE(KIO::AuthInfo)
384 
385 #endif
KIO::AuthInfo::comment
QString comment
Additional comment to be displayed when prompting the user for authentication information.
Definition: authinfo.h:166
kio_export.h
KIO::AuthInfo::modified
bool modified
Definition: authinfo.h:284
KIO::NetRC::AutoLogin::machine
QString machine
Definition: authinfo.h:335
KIO::AuthInfo::url
KUrl url
The URL for which authentication is to be stored.
Definition: authinfo.h:110
KIO::AuthInfo::FieldFlags
FieldFlags
Flags for extra fields.
Definition: authinfo.h:238
kurl.h
KIO::NetRC::AutoLogin::password
QString password
Definition: authinfo.h:337
KIO::AuthInfo::keepPassword
bool keepPassword
Flag to indicate the persistence of the given password.
Definition: authinfo.h:232
QDataStream
KIO::AuthInfo::digestInfo
QString digestInfo
Field to store any extra authentication information for protocols that need it.
Definition: authinfo.h:199
QMap< QString, QStringList >
extract
static QString extract(const QByteArray &buf, int &pos, const char c1= '\0')
extracts the string between the current position pos and the first occurrence of either c1 or comma (...
Definition: dataprotocol.cpp:108
KIO::AuthInfo
This class is intended to make it easier to prompt for, cache and retrieve authorization information...
Definition: authinfo.h:57
KIO::NetRC::AutoLogin::login
QString login
Definition: authinfo.h:336
KIO::AuthInfo::readOnly
bool readOnly
Flag which if set forces the username field to be read-only.
Definition: authinfo.h:219
KIO::operator<<
QDataStream & operator<<(QDataStream &s, const AuthInfo &a)
Definition: authinfo.cpp:209
KUrl
KIO::NetRC::LookUpModeFlag
LookUpModeFlag
Specifies the mode to be used when searching for a matching automatic login info for a given site : ...
Definition: authinfo.h:320
KIO::AuthInfo::realmValue
QString realmValue
A unique identifier that allows caching of multiple passwords for different resources in the same ser...
Definition: authinfo.h:189
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:212
QString
reload
const KShortcut & reload()
KIO::NetRC::AutoLogin::macdef
QMap< QString, QStringList > macdef
Definition: authinfo.h:338
QDBusArgument
KIO::operator>>
QDataStream & operator>>(QDataStream &s, AuthInfo &a)
Definition: authinfo.cpp:219
KIO::NetRC
A Singleton class that provides access to passwords stored in .netrc files for automatic login purpos...
Definition: authinfo.h:306
KIO::AuthInfo::password
QString password
This is required for caching.
Definition: authinfo.h:120
KIO::AuthInfo::username
QString username
This is required for caching.
Definition: authinfo.h:115
KIO::NetRC::AutoLogin::type
QString type
Definition: authinfo.h:334
parse
QList< Action > parse(QSettings &ini)
KIO::AuthInfo::caption
QString caption
The text to displayed in the title bar of the password prompting dialog.
Definition: authinfo.h:142
KIO::AuthInfo::commentLabel
QString commentLabel
Descriptive label to be displayed in front of the comment when prompting the user for password...
Definition: authinfo.h:175
KIO::AuthInfo::prompt
QString prompt
Information to be displayed when prompting the user for authentication information.
Definition: authinfo.h:131
QVariant
KIO::NetRC::AutoLogin
Contains auto login information.
Definition: authinfo.h:332
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:24:52 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KIO

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

kdelibs API Reference

Skip menu "kdelibs API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal