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

KDEUI

kpassworddialog.h

Go to the documentation of this file.
00001 /* This file is part of the KDE libraries
00002    Copyright (C) 2000 David Faure <faure@kde.org>
00003    Copyright (C) 2000 Dawit Alemayehu <adawit@kde.org>
00004    Copyright (C) 2007 Olivier Goffart <ogoffart at kde.org>
00005 
00006    This library is free software; you can redistribute it and/or
00007    modify it under the terms of the GNU Library General Public
00008    License version 2 as published by the Free Software Foundation.
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
00016    License along with this library; see the file COPYING.LIB.  If
00017    not, write to the Free Software Foundation, Inc., 51 Franklin Street,
00018    Fifth Floor, Boston, MA 02110-1301, USA.
00019 */
00020 
00021 #ifndef KPASSWORDDIALOG_H
00022 #define KPASSWORDDIALOG_H
00023 
00024 #include <kdialog.h>
00025 #include <QtCore/QFlags>
00026 
00054 class KDEUI_EXPORT KPasswordDialog : public KDialog
00055 {
00056     Q_OBJECT
00057 
00058 public:
00059     
00060     enum KPasswordDialogFlag
00061     {
00062         NoFlags = 0x00,
00067         ShowKeepPassword = 0x01,
00072         ShowUsernameLine = 0x02,
00076         UsernameReadOnly = 0x04,
00081         ShowAnonymousLoginCheckBox = 0x08,
00086         ShowDomainLine = 0x10,
00091         DomainReadOnly = 0x20
00092     };
00093     Q_DECLARE_FLAGS(KPasswordDialogFlags, KPasswordDialogFlag)
00094 
00095     enum ErrorType
00096     {
00097         UnknownError = 0,
00098 
00102         UsernameError,
00103         
00107         PasswordError,
00108 
00112         FatalError,
00113         
00118         DomainError        
00119     };
00120 
00130     explicit KPasswordDialog( QWidget *parent = 0L,
00131                               const KPasswordDialogFlags& flags = 0,
00132                               const KDialog::ButtonCodes otherButtons = 0);
00133 
00137     ~KPasswordDialog();
00138 
00143     void setPrompt( const QString& prompt );
00144 
00148     QString prompt() const;
00149 
00153     void setPixmap(const QPixmap&);
00157     QPixmap pixmap() const;
00158 
00169     void addCommentLine( const QString& label, const QString& comment );
00170 
00176     void showErrorMessage( const QString& message, const ErrorType type = PasswordError );
00177 
00182     QString password() const;
00183 
00187     void setUsername(const QString&);
00188 
00193     QString username() const;
00194 
00199     void setDomain(const QString&);
00200 
00206     QString domain() const;
00207     
00212     void setAnonymousMode(bool anonymous);
00213 
00218     bool anonymousMode() const;    
00219     
00229     bool keepPassword() const;
00230 
00239     void setKeepPassword( bool b );
00240 
00249     void setUsernameReadOnly( bool readOnly );
00250 
00255     void setPassword( const QString& password );
00256 
00264     void setKnownLogins( const QMap<QString, QString>& knownLogins );
00265 
00269     void accept();
00270 
00271 Q_SIGNALS:
00277     void gotPassword( const QString& password , bool keep );
00278 
00285     void gotUsernameAndPassword( const QString& username, const QString& password , bool keep );
00286 
00287 protected:
00293     virtual bool checkPassword();
00294 
00295 
00296 private:
00297     Q_PRIVATE_SLOT(d, void actuallyAccept())
00298     Q_PRIVATE_SLOT(d, void activated( const QString& userName ))
00299     Q_PRIVATE_SLOT(d, void updateFields())
00300 
00301 private:
00302     class KPasswordDialogPrivate;
00303     friend class KPasswordDialogPrivate;
00304     KPasswordDialogPrivate* const d;
00305     
00306     Q_DISABLE_COPY(KPasswordDialog)
00307 };
00308 
00309 Q_DECLARE_OPERATORS_FOR_FLAGS(KPasswordDialog::KPasswordDialogFlags)
00310 
00311 #endif

KDEUI

Skip menu "KDEUI"
  • Main Page
  • Modules
  • 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