certmanager/lib
kconfigbasedkeyfilter.h00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033 #ifndef __KLEO_KCONFIGBASEDKEYFILTER_H__
00034 #define __KLEO_KCONFIGBASEDKEYFILTER_H__
00035
00036 #include "keyfilter.h"
00037
00038 #include <qfont.h>
00039 #include <qstring.h>
00040 #include <qcolor.h>
00041
00042 #include <gpgmepp/key.h>
00043
00044 class KConfigBase;
00045
00046 namespace Kleo {
00047
00048 class KConfigBasedKeyFilter : public KeyFilter {
00049 public:
00050 explicit KConfigBasedKeyFilter( const KConfigBase & config );
00051 ~KConfigBasedKeyFilter();
00052 bool matches( const GpgME::Key & key ) const;
00053
00054 unsigned int specificity() const { return mSpecificity; }
00055
00056 QColor fgColor() const { return mFgColor; }
00057 QColor bgColor() const { return mBgColor; }
00058 QFont font( const QFont & ) const;
00059 QString name() const { return mName; }
00060 QString icon() const { return mIcon; }
00061
00062 private:
00063 QColor mFgColor, mBgColor;
00064 QString mName;
00065 QString mIcon;
00066 unsigned int mSpecificity;
00067 bool mItalic;
00068 bool mBold;
00069 bool mStrikeOut;
00070 bool mUseFullFont;
00071 QFont mFont;
00072
00073 enum TriState {
00074 DoesNotMatter = 0,
00075 Set = 1,
00076 NotSet = 2
00077 };
00078 TriState mRevoked;
00079 TriState mExpired;
00080 TriState mDisabled;
00081 TriState mRoot;
00082 TriState mCanEncrypt;
00083 TriState mCanSign;
00084 TriState mCanCertify;
00085 TriState mCanAuthenticate;
00086 TriState mHasSecret;
00087 TriState mIsOpenPGP;
00088 TriState mWasValidated;
00089 enum LevelState {
00090 LevelDoesNotMatter = 0,
00091 Is = 1,
00092 IsNot = 2,
00093 IsAtLeast = 3,
00094 IsAtMost = 4
00095 };
00096 LevelState mOwnerTrust;
00097 GpgME::Key::OwnerTrust mOwnerTrustReferenceLevel;
00098 LevelState mValidity;
00099 GpgME::UserID::Validity mValidityReferenceLevel;
00100 };
00101
00102 }
00103
00104 #endif // __KLEO_KCONFIGBASEDKEYFILTER_H__
|