certmanager Library API Documentation

cryptoconfig.h

00001 /*
00002     cryptoconfig.h
00003 
00004     This file is part of libkleopatra, the KDE keymanagement library
00005     Copyright (c) 2004 Klarälvdalens Datakonsult AB
00006 
00007     Libkleopatra is free software; you can redistribute it and/or
00008     modify it under the terms of the GNU General Public License as
00009     published by the Free Software Foundation; either version 2 of the
00010     License, or (at your option) any later version.
00011 
00012     Libkleopatra 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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  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 CRYPTOCONFIG_H
00034 #define CRYPTOCONFIG_H
00035 
00036 #include <kurl.h>
00037 
00038 // Start reading this file from the bottom up :)
00039 
00040 namespace Kleo {
00041 
00045   class CryptoConfigEntry {
00046 
00047   public:
00053     enum Level { Level_Basic = 0,
00054                  Level_Advanced = 1,
00055                  Level_Expert = 2 };
00056 
00070     enum ArgType { ArgType_None = 0,
00071                    ArgType_String = 1,
00072                    ArgType_Int = 2,
00073                    ArgType_UInt = 3,
00074                    ArgType_Path = 4,
00075                    ArgType_URL = 5,
00076                    ArgType_LDAPURL = 6 };
00077 
00078     virtual ~CryptoConfigEntry() {}
00079 
00083     virtual QString description() const = 0;
00084 
00088     virtual bool isOptional() const = 0;
00089 
00093     virtual bool isList() const = 0;
00094 
00098     virtual bool isRuntime() const = 0;
00099 
00103     virtual Level level() const = 0;
00104 
00108     virtual ArgType argType() const = 0;
00109 
00113     virtual bool isSet() const = 0;
00114 
00118     virtual bool boolValue() const = 0;
00119 
00124     virtual QString stringValue() const = 0;
00125 
00129     virtual int intValue() const = 0;
00130 
00134     virtual unsigned int uintValue() const = 0;
00135 
00139     virtual KURL urlValue() const = 0;
00140 
00144     virtual unsigned int numberOfTimesSet() const = 0;
00145 
00149     virtual QStringList stringValueList() const = 0;
00150 
00154     virtual QValueList<int> intValueList() const = 0;
00155 
00159     virtual QValueList<unsigned int> uintValueList() const = 0;
00160 
00164     virtual KURL::List urlValueList() const = 0;
00165 
00169     virtual void resetToDefault() = 0;
00170 
00175     virtual void setBoolValue( bool ) = 0;
00176 
00180     virtual void setStringValue( const QString& ) = 0;
00181 
00185     virtual void setIntValue( int ) = 0;
00186 
00190     virtual void setUIntValue( unsigned int ) = 0;
00191 
00195     virtual void setURLValue( const KURL& ) = 0;
00196 
00200     virtual void setNumberOfTimesSet( unsigned int ) = 0;
00201 
00205     virtual void setStringValueList( const QStringList& ) = 0;
00206 
00210     virtual void setIntValueList( const QValueList<int>& ) = 0;
00211 
00215     virtual void setUIntValueList( const QValueList<unsigned int>& ) = 0;
00216 
00220     virtual void setURLValueList( const KURL::List& ) = 0;
00221 
00225     virtual bool isDirty() const = 0;
00226   };
00227 
00231   class CryptoConfigGroup {
00232 
00233   public:
00234     virtual ~CryptoConfigGroup() {}
00235 
00239     virtual QString description() const = 0;
00240 
00244     virtual CryptoConfigEntry::Level level() const = 0;
00245 
00251     virtual QStringList entryList() const = 0;
00252 
00258     virtual CryptoConfigEntry* entry( const QString& name ) const = 0;
00259   };
00260 
00264   class CryptoConfigComponent {
00265 
00266   public:
00267     virtual ~CryptoConfigComponent() {}
00268 
00272     virtual QString description() const = 0;
00273 
00280     virtual QStringList groupList() const = 0;
00281 
00286     virtual CryptoConfigGroup* group( const QString& name ) const = 0;
00287 
00288   };
00289 
00293   class CryptoConfig {
00294 
00295   public:
00296     virtual ~CryptoConfig() {}
00297 
00303     virtual QStringList componentList() const = 0;
00304 
00309     virtual CryptoConfigComponent* component( const QString& name ) const = 0;
00310 
00319     CryptoConfigEntry* entry( const QString& componentName, const QString& groupName, const QString& entryName ) const {
00320       const Kleo::CryptoConfigComponent* comp = component( componentName );
00321       const Kleo::CryptoConfigGroup* group = comp ? comp->group( groupName ) : 0;
00322       return group ? group->entry( entryName ) : 0;
00323     }
00324 
00332     virtual void sync( bool runtime ) = 0;
00333 
00341     virtual void clear() = 0;
00342   };
00343 
00344 }
00345 
00346 #endif /* CRYPTOCONFIG_H */
KDE Logo
This file is part of the documentation for certmanager Library Version 3.3.2.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Wed Mar 23 22:39:32 2005 by doxygen 1.3.9.1 written by Dimitri van Heesch, © 1997-2003