field.h
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef KABC_FIELD_H
00022 #define KABC_FIELD_H
00023
00024 #include <qstring.h>
00025 #include <qvaluelist.h>
00026
00027 #include "addressee.h"
00028
00029 class KConfig;
00030
00031 namespace KABC {
00032
00033 class Field
00034 {
00035 class FieldImpl;
00036 friend class FieldImpl;
00037
00038 public:
00039 typedef QValueList<Field *> List;
00040
00050 enum FieldCategory
00051 {
00052 All = 0x0,
00053 Frequent = 0x01,
00054 Address = 0x02,
00055 Email = 0x04,
00056 Personal = 0x08,
00057 Organization = 0x10,
00058 CustomCategory = 0x20
00059 };
00060
00064 virtual QString label();
00065
00069 virtual int category();
00070
00074 static QString categoryLabel( int category );
00075
00081 virtual QString value( const KABC::Addressee & );
00082
00087 virtual bool setValue( KABC::Addressee &, const QString & );
00088
00092 virtual bool isCustom();
00093
00097 virtual bool equals( Field *field );
00098
00102 static Field::List allFields();
00103
00107 static Field::List defaultFields();
00108
00117 static Field *createCustomField( const QString &label, int category,
00118 const QString &key, const QString &app );
00119
00123 static void deleteFields();
00124
00132 static void saveFields( KConfig *cfg, const QString &identifier,
00133 const Field::List &fields );
00138 static void saveFields( const QString &identifier,
00139 const Field::List &fields );
00140
00147 static Field::List restoreFields( KConfig *cfg, const QString &identifier );
00148
00153 static Field::List restoreFields( const QString &identifier );
00154
00155 protected:
00156 static void createField( int id, int category = 0 );
00157 static void createDefaultField( int id, int category = 0 );
00158
00159 private:
00160 Field( FieldImpl * );
00161 virtual ~Field();
00162
00163 FieldImpl *mImpl;
00164
00165 static Field::List mAllFields;
00166 static Field::List mDefaultFields;
00167 static Field::List mCustomFields;
00168 };
00169
00170 }
00171 #endif
This file is part of the documentation for kdelibs Version 3.1.5.