home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2009 February / PCWFEB09.iso / Software / Linux / SLAX 6.0.8 / slax-6.0.8.iso / slax / base / 006-devel.lzm / usr / include / ksslcertdlg.h < prev    next >
Encoding:
C/C++ Source or Header  |  2005-10-10  |  3.6 KB  |  139 lines

  1. /* This file is part of the KDE project
  2.  *
  3.  * Copyright (C) 2001-2003 George Staikos <staikos@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 _KSSLCERTDLG_H
  22. #define _KSSLCERTDLG_H
  23.  
  24. #include <qstringlist.h>
  25. #include <kdialog.h>
  26.  
  27. class QWidget;
  28. class QCheckBox;
  29. class QRadioButton;
  30. class QListView;
  31. class QPushButton;
  32.  
  33. /**
  34.  * KDE X.509 Certificate Dialog
  35.  *
  36.  * This class is used to create and display a dialog which contains the user's
  37.  * X.509 certificates and allows the user to present it during SSL sessions.
  38.  *
  39.  * @author George Staikos <staikos@kde.org>
  40.  * @see KSSL
  41.  * @short KDE X.509 Certificate Dialog
  42.  */
  43. class KIO_EXPORT KSSLCertDlg : public KDialog {
  44.     Q_OBJECT
  45. public:
  46.     /**
  47.      *  Construct a KSSL certificate dialog
  48.      *
  49.      *  @param parent the parent widget
  50.      *  @param name the internal name of this instance
  51.      *  @param modal create a modal dialog if set to true
  52.      */
  53.     KSSLCertDlg(QWidget *parent=0L, const char *name=0L, bool modal=false);
  54.  
  55.     /**
  56.      *  Destroy this object and close the dialog
  57.      */
  58.     virtual ~KSSLCertDlg();
  59.  
  60.     /**
  61.      *  Setup the dialog. Call this before you display the dialog.
  62.      *
  63.      *  @param certs the list of possible certificates
  64.      *  @param saveChecked save the checked item for the future
  65.      *  @param sendChecked send the checked item to the remote host
  66.      *  @deprecated
  67.      */
  68.     void setup(QStringList certs, bool saveChecked = false, bool sendChecked = true) KDE_DEPRECATED;
  69.  
  70.     /**
  71.      *  Setup the dialog. Call this before you display the dialog.
  72.      *
  73.      *  @param certs the list of possible certificates
  74.      *  @param saveChecked save the checked item for the future
  75.      *  @param sendChecked send the checked item to the remote host
  76.      */
  77.     void setupDialog(const QStringList& certs, bool saveChecked = false, bool sendChecked = true);
  78.  
  79.     /**
  80.      *  Obtain the name of the certificate the user wants to send
  81.      *
  82.      *  @return the name of the certificate
  83.      */
  84.     QString getChoice();
  85.  
  86.     /**
  87.      *  Determine if the user wants to send a certificate.
  88.      *
  89.      *  @return true if the user wants to send a certificate
  90.      */
  91.     bool wantsToSend();
  92.  
  93.     /**
  94.      *  Determine if the user wants to save the choice for the future.
  95.      *
  96.      *  @return true if the user wants to save the choice.
  97.      */
  98.     bool saveChoice();
  99.  
  100.     /**
  101.      *  Set the hostname that we are connecting to.
  102.      *
  103.      *  @param host the hostname
  104.      */
  105.     void setHost(const QString& host);
  106.  
  107. private slots:
  108.     void slotSend();
  109.     void slotDont();
  110.  
  111. private:
  112.     class KSSLCertDlgPrivate;
  113.     KSSLCertDlgPrivate *d;
  114.     QCheckBox *_save;
  115.     QRadioButton *_send, *_dont;
  116.     QListView *_certs;
  117.     QPushButton *_ok;
  118.     QString _host;
  119. };
  120.  
  121.  
  122. class KIO_EXPORT KSSLCertDlgRet {
  123. public:
  124.    bool ok;
  125.    QString choice;
  126.    bool send;
  127.    bool save;
  128.  
  129. protected:
  130.    class KSSLCertDlgRetPrivate;
  131.    KSSLCertDlgRetPrivate *d;
  132. };
  133.  
  134. KIO_EXPORT QDataStream& operator<<(QDataStream& s, const KSSLCertDlgRet& r);
  135. KIO_EXPORT QDataStream& operator>>(QDataStream& s, KSSLCertDlgRet& r);
  136.  
  137. #endif
  138.  
  139.