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 #ifdef __cplusplus
00037 /* we read this file from a C compiler, and are only interested in the
00038  * enums... */
00039 
00040 #include <kurl.h>
00041 
00042 /* Start reading this file from the bottom up :) */
00043 
00044 namespace Kleo {
00045 
00049   class CryptoConfigEntry {
00050 
00051   public:
00052 #endif /* __cplusplus */
00053 
00058     enum Level { Level_Basic = 0,
00059                  Level_Advanced = 1,
00060                  Level_Expert = 2 };
00061 
00079     enum ArgType { ArgType_None = 0,
00080                    ArgType_String = 1,
00081                    ArgType_Int = 2,
00082                    ArgType_UInt = 3,
00083                    ArgType_Path = 4,
00084                    ArgType_URL = 5,
00085                    ArgType_LDAPURL = 6,
00086                    ArgType_DirPath = 7 };
00087 
00088 #ifdef __cplusplus
00089     virtual ~CryptoConfigEntry() {}
00090 
00094     virtual QString name() const = 0;
00095 
00099     virtual QString description() const = 0;
00100 
00104     virtual bool isOptional() const = 0;
00105 
00109     virtual bool isReadOnly() const = 0;
00110 
00114     virtual bool isList() const = 0;
00115 
00119     virtual bool isRuntime() const = 0;
00120 
00124     virtual Level level() const = 0;
00125 
00129     virtual ArgType argType() const = 0;
00130 
00134     virtual bool isSet() const = 0;
00135 
00139     virtual bool boolValue() const = 0;
00140 
00145     virtual QString stringValue() const = 0;
00146 
00150     virtual int intValue() const = 0;
00151 
00155     virtual unsigned int uintValue() const = 0;
00156 
00160     virtual KURL urlValue() const = 0;
00161 
00165     virtual unsigned int numberOfTimesSet() const = 0;
00166 
00170     virtual QStringList stringValueList() const = 0;
00171 
00175     virtual QValueList<int> intValueList() const = 0;
00176 
00180     virtual QValueList<unsigned int> uintValueList() const = 0;
00181 
00185     virtual KURL::List urlValueList() const = 0;
00186 
00190     virtual void resetToDefault() = 0;
00191 
00196     virtual void setBoolValue( bool ) = 0;
00197 
00201     virtual void setStringValue( const QString& ) = 0;
00202 
00206     virtual void setIntValue( int ) = 0;
00207 
00211     virtual void setUIntValue( unsigned int ) = 0;
00212 
00216     virtual void setURLValue( const KURL& ) = 0;
00217 
00221     virtual void setNumberOfTimesSet( unsigned int ) = 0;
00222 
00226     virtual void setStringValueList( const QStringList& ) = 0;
00227 
00231     virtual void setIntValueList( const QValueList<int>& ) = 0;
00232 
00236     virtual void setUIntValueList( const QValueList<unsigned int>& ) = 0;
00237 
00241     virtual void setURLValueList( const KURL::List& ) = 0;
00242 
00246     virtual bool isDirty() const = 0;
00247   };
00248 
00252   class CryptoConfigGroup {
00253 
00254   public:
00255     virtual ~CryptoConfigGroup() {}
00256 
00260     virtual QString name() const = 0;
00261 
00265     virtual QString iconName() const = 0;
00266 
00270     virtual QString description() const = 0;
00271 
00275     virtual CryptoConfigEntry::Level level() const = 0;
00276 
00282     virtual QStringList entryList() const = 0;
00283 
00289     virtual CryptoConfigEntry* entry( const QString& name ) const = 0;
00290   };
00291 
00295   class CryptoConfigComponent {
00296 
00297   public:
00298     virtual ~CryptoConfigComponent() {}
00299 
00303     virtual QString name() const = 0;
00304 
00308     virtual QString iconName() const = 0;
00309 
00313     virtual QString description() const = 0;
00314 
00321     virtual QStringList groupList() const = 0;
00322 
00327     virtual CryptoConfigGroup* group( const QString& name ) const = 0;
00328 
00329   };
00330 
00334   class CryptoConfig {
00335 
00336   public:
00337     virtual ~CryptoConfig() {}
00338 
00344     virtual QStringList componentList() const = 0;
00345 
00350     virtual CryptoConfigComponent* component( const QString& name ) const = 0;
00351 
00360     CryptoConfigEntry* entry( const QString& componentName, const QString& groupName, const QString& entryName ) const {
00361       const Kleo::CryptoConfigComponent* comp = component( componentName );
00362       const Kleo::CryptoConfigGroup* group = comp ? comp->group( groupName ) : 0;
00363       return group ? group->entry( entryName ) : 0;
00364     }
00365 
00373     virtual void sync( bool runtime ) = 0;
00374 
00382     virtual void clear() = 0;
00383   };
00384 
00385 }
00386 #endif /* __cplusplus */
00387 #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 Thu Aug 23 18:19:05 2007 by doxygen 1.4.2 written by Dimitri van Heesch, © 1997-2003