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

KIO

authinfo.h

Go to the documentation of this file.
00001 /*
00002  *  This file is part of the KDE libraries
00003  *  Copyright (C) 2000-2001 Dawit Alemayehu <adawit@kde.org>
00004  *
00005  *  This library is free software; you can redistribute it and/or
00006  *  modify it under the terms of the GNU Library General Public
00007  *  License as published by the Free Software Foundation; either
00008  *  version 2 of the License, or (at your option) any later version.
00009  *
00010  *  This library is distributed in the hope that it will be useful,
00011  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013  *  Library General Public License for more details.
00014  *
00015  *  You should have received a copy of the GNU Library General Public License
00016  *  along with this library; see the file COPYING.LIB.  If not, write to
00017  *  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00018  *  Boston, MA 02110-1301, USA.
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 class QDBusArgument;
00032 
00033 namespace KIO {
00034 
00035 class AuthInfoPrivate;
00036 
00057 class KIO_EXPORT AuthInfo
00058 {
00059     KIO_EXPORT friend QDataStream& operator<< (QDataStream& s, const AuthInfo& a);
00060     KIO_EXPORT friend QDataStream& operator>> (QDataStream& s, AuthInfo& a);
00061 
00062     KIO_EXPORT friend QDBusArgument &operator<<(QDBusArgument &argument, const AuthInfo &a);
00063     KIO_EXPORT friend const QDBusArgument &operator>>(const QDBusArgument &argument, AuthInfo &a);
00064 
00065 public:
00066     
00070    AuthInfo();
00071 
00075    AuthInfo( const AuthInfo& info );
00076    
00081    ~AuthInfo();
00082    
00086    AuthInfo& operator=( const AuthInfo& info );
00087 
00092    bool isModified() const;
00093 
00098    void setModified( bool flag );
00099 
00110    KUrl url;
00111 
00115    QString username;
00116 
00120    QString password;
00121 
00131    QString prompt;
00132 
00142    QString caption;
00143 
00166    QString comment;
00167 
00175    QString commentLabel;
00176 
00193    QString realmValue;
00194 
00203    QString digestInfo;
00204 
00216    bool verifyPath;
00217 
00223    bool readOnly;
00224 
00236    bool keepPassword;
00237    
00242    enum FieldFlags
00243    {
00244        ExtraFieldNoFlags = 0,
00245        ExtraFieldReadOnly = 1<<1,
00246        ExtraFieldMandatory = 1<<2
00247    };
00248    
00258    void setExtraField(const QString &fieldName, const QVariant & value);
00259    
00264    void setExtraFieldFlags(const QString &fieldName, const FieldFlags flags);
00265    
00271    QVariant getExtraField(const QString &fieldName) const;
00272    
00277    AuthInfo::FieldFlags getExtraFieldFlags(const QString &fieldName) const;
00278 
00285    static void registerMetaTypes();
00286    
00287 protected:
00288     bool modified;
00289 private:
00290     friend class ::KIO::AuthInfoPrivate;
00291     AuthInfoPrivate * const d;
00292 };
00293 
00294 KIO_EXPORT QDataStream& operator<< (QDataStream& s, const AuthInfo& a);
00295 KIO_EXPORT QDataStream& operator>> (QDataStream& s, AuthInfo& a);
00296 
00297 KIO_EXPORT QDBusArgument &operator<<(QDBusArgument &argument, const AuthInfo &a);
00298 KIO_EXPORT const QDBusArgument &operator>>(const QDBusArgument &argument, AuthInfo &a);
00299 
00309 class KIO_EXPORT NetRC
00310 {
00311 public:
00312 
00323   enum LookUpModeFlag
00324   {
00325       exactOnly = 0x0002,
00326       defaultOnly = 0x0004,
00327       presetOnly = 0x0008
00328   };
00329   Q_DECLARE_FLAGS(LookUpMode, LookUpModeFlag)
00330 
00331   
00335   struct AutoLogin
00336   {
00337     QString type;
00338     QString machine;
00339     QString login;
00340     QString password;
00341     QMap<QString, QStringList> macdef;
00342   };
00343 
00348   static NetRC* self();
00349 
00360   bool lookup( const KUrl& url, AutoLogin& login,
00361                bool userealnetrc = false,
00362                const QString &type = QString(),
00363                LookUpMode mode = LookUpMode(exactOnly) | defaultOnly );
00367   void reload();
00368 
00369 protected:
00370   QString extract( const char*, const char*, int& );
00371   int openf( const QString& );
00372   bool parse( int );
00373 
00374 private:
00375   NetRC();
00376   ~NetRC();
00377 
00378 private:
00379   static NetRC* instance;
00380 
00381   class NetRCPrivate;
00382   NetRCPrivate* const d;
00383 };
00384 }
00385 Q_DECLARE_OPERATORS_FOR_FLAGS(KIO::NetRC::LookUpMode)
00386 Q_DECLARE_METATYPE(KIO::AuthInfo)
00387 
00388 #endif

KIO

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

kdelibs

Skip menu "kdelibs"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • Kate
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Generated for kdelibs by doxygen 1.6.1
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