• Skip to content
  • Skip to link menu
KDE 4.2 API Reference
  • KDE API Reference
  • kdepim
  • Sitemap
  • Contact Us
 

libkleo

directoryserviceswidget.h

Go to the documentation of this file.
00001 /*
00002     directoryserviceswidget.h
00003 
00004     This file is part of Kleopatra, the KDE keymanager
00005     Copyright (c) 2001,2002,2004 Klarälvdalens Datakonsult AB
00006 
00007     Kleopatra is free software; you can redistribute it and/or modify
00008     it under the terms of the GNU General Public License as published by
00009     the Free Software Foundation; either version 2 of the License, or
00010     (at your option) any later version.
00011 
00012     Kleopatra is distributed in the hope that it will be useful,
00013     but WITHOUT ANY WARRANTY; without even the implied warranty of
00014     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00015     General Public License for more details.
00016 
00017     You should have received a copy of the GNU General Public License
00018     along with this program; if not, write to the Free Software
00019     Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
00020 
00021     In addition, as a special exception, the copyright holders give
00022     permission to link the code of this program with any edition of
00023     the Qt library by Trolltech AS, Norway (or with modified versions
00024     of Qt that use the same license as Qt), and distribute linked
00025     combinations including the two.  You must obey the GNU General
00026     Public License in all respects for all of the code used other than
00027     Qt.  If you modify this file, you may extend this exception to
00028     your version of the file, but you are not obligated to do so.  If
00029     you do not wish to do so, delete this exception statement from
00030     your version.
00031 */
00032 
00033 #ifndef DIRECTORYSERVICESWIDGET_H
00034 #define DIRECTORYSERVICESWIDGET_H
00035 
00036 #include "kleo/kleo_export.h"
00037 #include <kurl.h>
00038 #include <QtGui/QWidget>
00039 
00040 namespace Kleo {
00041 
00042 class KLEO_EXPORT DirectoryServicesWidget : public QWidget {
00043   Q_OBJECT
00044 public:
00045   explicit DirectoryServicesWidget( QWidget * parent=0, Qt::WindowFlags f=0 );
00046   ~DirectoryServicesWidget();
00047 
00048   enum Scheme {
00049       NoScheme = 0,
00050       HKP      = 1,
00051       HTTP     = 2,
00052       FTP      = 4,
00053       LDAP     = 8,
00054 
00055       AllSchemes = HKP|HTTP|FTP|LDAP
00056   };
00057   Q_DECLARE_FLAGS( Schemes, Scheme )
00058 
00059   enum Protocol {
00060       NoProtocol = 0,
00061       X509Protocol = 1,
00062       OpenPGPProtocol = 2,
00063 
00064       AllProtocols = X509Protocol|OpenPGPProtocol
00065   };
00066   Q_DECLARE_FLAGS( Protocols, Protocol )
00067 
00068   void setAllowedSchemes( Schemes schemes );
00069   Schemes allowedSchemes() const;
00070 
00071   void setAllowedProtocols( Protocols protocols );
00072   Protocols allowedProtocols() const;
00073 
00074   void setX509Allowed( bool allowed );
00075   void setOpenPGPAllowed( bool allowed );
00076 
00077   void setReadOnlyProtocols( Protocols protocols );
00078   Protocols readOnlyProtocols() const;
00079 
00080   void setOpenPGPReadOnly( bool ro );
00081   void setX509ReadOnly( bool ro );
00082 
00083   void addOpenPGPServices( const KUrl::List& urls );
00084   KUrl::List openPGPServices() const;
00085 
00086   void addX509Services( const KUrl::List& urls );
00087   KUrl::List x509Services() const;
00088 
00089 public Q_SLOTS:
00090   void clear();
00091 
00092 Q_SIGNALS:
00093   void changed();
00094 
00095 private:
00096   class Private;
00097   Private * const d;
00098   Q_PRIVATE_SLOT( d, void slotNewClicked() )
00099   Q_PRIVATE_SLOT( d, void slotNewX509Clicked() )
00100   Q_PRIVATE_SLOT( d, void slotNewOpenPGPClicked() )
00101   Q_PRIVATE_SLOT( d, void slotDeleteClicked() )
00102   Q_PRIVATE_SLOT( d, void slotSelectionChanged() )
00103   Q_PRIVATE_SLOT( d, void slotShowUserAndPasswordToggled(bool) )
00104 };
00105 
00106 }
00107 
00108 inline void Kleo::DirectoryServicesWidget::setOpenPGPAllowed( bool allowed ) {
00109     if ( allowed )
00110         setAllowedProtocols( allowedProtocols() | OpenPGPProtocol );
00111     else
00112         setAllowedProtocols( allowedProtocols() & ~OpenPGPProtocol );
00113 }
00114 
00115 inline void Kleo::DirectoryServicesWidget::setX509Allowed( bool allowed ) {
00116     if ( allowed )
00117         setAllowedProtocols( allowedProtocols() | X509Protocol );
00118     else
00119         setAllowedProtocols( allowedProtocols() & ~X509Protocol );
00120 }
00121 
00122 inline void Kleo::DirectoryServicesWidget::setOpenPGPReadOnly( bool ro ) {
00123     if ( ro )
00124         setReadOnlyProtocols( readOnlyProtocols() | OpenPGPProtocol );
00125     else
00126         setReadOnlyProtocols( readOnlyProtocols() & ~OpenPGPProtocol );
00127 }
00128 
00129 inline void Kleo::DirectoryServicesWidget::setX509ReadOnly( bool ro ) {
00130     if ( ro )
00131         setReadOnlyProtocols( readOnlyProtocols() | X509Protocol );
00132     else
00133         setReadOnlyProtocols( readOnlyProtocols() & ~X509Protocol );
00134 }
00135 
00136 #endif // DIRECTORYSERVICESWIDGET_H

libkleo

Skip menu "libkleo"
  • Main Page
  • Modules
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members

kdepim

Skip menu "kdepim"
  • akonadi
  •   clients
  •   kabc
  •   kcal
  •   kcm
  • akregator
  • console
  •   kabcclient
  •   konsolekalendar
  • kaddressbook
  • kalarm
  •   lib
  • kdgantt
  • kdgantt1
  • kjots
  • kleopatra
  • kmail
  • kmobiletools
  • knode
  • knotes
  • kontact
  • kontactinterfaces
  • korganizer
  •   korgac
  • kpilot
  • ktimetracker
  • libkdepim
  • libkholidays
  • libkleo
  • libkpgp
  • maildir
Generated for kdepim by doxygen 1.5.4
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