TDE core libraries
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

139 line
3.6KB

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