kio Library API Documentation

passdlg.h

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 
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 version 2 as published by the Free Software Foundation.
00008 
00009    This library is distributed in the hope that it will be useful,
00010    but WITHOUT ANY WARRANTY; without even the implied warranty of
00011    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012    Library General Public License for more details.
00013 
00014    You should have received a copy of the GNU Library General Public
00015    License along with this library; see the file COPYING.LIB.  If
00016    not, write to the Free Software Foundation, Inc., 59 Temple
00017    Place - Suite 330, Boston, MA 02111-1307, USA.
00018 */
00019 
00020 #ifndef __kio_pass_dlg_h__
00021 #define __kio_pass_dlg_h__
00022 
00023 #include <kdialogbase.h>
00024 
00025 class QGridLayout;
00026 
00027 namespace KIO {
00028 
00035 class PasswordDialog : public KDialogBase 
00036 {
00037     Q_OBJECT
00038 
00039 public:
00050     PasswordDialog( const QString& prompt, const QString& user,
00051                     bool enableKeep = false, bool modal=true,
00052                     QWidget* parent=0, const char* name=0 );
00053 
00057     ~PasswordDialog();
00058 
00062     void setPrompt( const QString& prompt );
00063 
00074     void addCommentLine( const QString& label, const QString comment );
00075 
00079     QString password() const;
00080     
00084     QString username() const;
00085 
00090     bool keepPassword() const;
00091 
00098     void setUserReadOnly( bool readOnly );
00099 
00103     void setEnableUserField( bool enable, bool=false ) {
00104     setUserReadOnly( !enable );
00105     };
00106 
00111     void setPassword( const QString& password );
00112 
00129     static int getNameAndPassword( QString& user, QString& pass, bool* keep,
00130                                    const QString& prompt = QString::null,
00131                                    bool readOnly = false,
00132                                    const QString& caption = QString::null,
00133                                    const QString& comment = QString::null,
00134                                    const QString& label = QString::null );
00135 
00136 private slots:
00137     void slotKeep( bool );
00138 
00139 private:
00140     void init( const QString&, const QString&, bool );
00141 
00142 protected:
00143     virtual void virtual_hook( int id, void* data );
00144 private:
00145     struct PasswordDialogPrivate;
00146     PasswordDialogPrivate* d;
00147 };
00148 
00149 };
00150 
00151 #endif
KDE Logo
This file is part of the documentation for kdelibs Version 3.1.0.
Documentation copyright © 1996-2002 the KDE developers.
Generated on Wed Oct 8 12:21:33 2003 by doxygen 1.2.18 written by Dimitri van Heesch, © 1997-2001