00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef __CPbkFieldInfo_H__
00023 #define __CPbkFieldInfo_H__
00024
00025
00026 #include <e32std.h>
00027 #include <cntdef.h>
00028 #include "PbkFields.hrh"
00029 #include "PbkIconId.hrh"
00030
00031
00032 class CContentType;
00033 class CContactItemField;
00034 class CContactItemViewDef;
00035 class CContactItemFieldDef;
00036 class CPbkFieldsInfo;
00037 class TResourceReader;
00038 class CPbkFieldInfoGroup;
00039 class CPbkFieldImportType;
00040 class TPbkContactItemFieldType;
00041 class TPbkVcardFieldType;
00042 class CPbkUidMap;
00043 class TPbkMatchPriorityLevel;
00044
00045
00046
00056 class CPbkFieldInfo :
00057 public CBase
00058 {
00059 public:
00064 IMPORT_C TPbkFieldId FieldId() const;
00065
00070 IMPORT_C TStorageType FieldStorageType() const;
00071
00077 IMPORT_C const CContentType& ContentType() const;
00078
00083 IMPORT_C TInt Category() const;
00084
00089 IMPORT_C const TDesC& FieldName() const;
00090
00095 IMPORT_C TUint Flags() const;
00096
00101 IMPORT_C TPbkFieldMultiplicity Multiplicity() const;
00102
00109 IMPORT_C TInt MaxLength() const;
00110
00115 IMPORT_C TPbkFieldEditMode EditMode() const;
00116
00121 IMPORT_C TPbkFieldDefaultCase DefaultCase() const;
00122
00127 IMPORT_C TPbkIconId IconId() const;
00128
00133 IMPORT_C TPbkFieldCtrlType CtrlType() const;
00134
00139 IMPORT_C TUint AddFlags() const;
00140
00147 IMPORT_C TPbkAddItemOrdering AddItemOrdering() const;
00148
00153 IMPORT_C TBool IsHidden() const;
00154
00159 IMPORT_C TBool IsReadOnly() const;
00160
00165 IMPORT_C TBool DoSynchronize() const;
00166
00171 IMPORT_C TBool IsDisabled() const;
00172
00177 IMPORT_C TBool NameField() const;
00178
00184 IMPORT_C TBool TemplateField() const;
00185
00191 IMPORT_C TBool UserCanAddField() const;
00192
00199 IMPORT_C TBool IsEditable() const;
00200
00205 IMPORT_C TBool NumericField() const;
00206
00211 IMPORT_C TBool IsPhoneNumberField() const;
00212
00218 IMPORT_C TBool IsEmailOverSmsField() const;
00219
00224 IMPORT_C TBool IsEmailField() const;
00225
00230 IMPORT_C TBool IsMmsField() const;
00231
00236 IMPORT_C TBool IsImageField() const;
00237
00242 IMPORT_C TBool IsPocField() const;
00243
00248 IMPORT_C TBool IsVoipField() const;
00249
00255 IMPORT_C TBool IsSame(const CPbkFieldInfo& aFieldInfo) const;
00256
00262 IMPORT_C TBool Match(TPbkFieldId aFieldId) const;
00263
00271 TBool Match(const TPbkContactItemFieldType& aFieldType) const;
00272
00281 TBool Match
00282 (const TPbkContactItemFieldType& aFieldType,
00283 const TPbkMatchPriorityLevel& aMatchPriority) const;
00284
00293 TBool Match
00294 (const TPbkVcardFieldType& aVcardType,
00295 const TPbkMatchPriorityLevel& aMatchPriority) const;
00296
00308 IMPORT_C TBool Match(const CContactItemField& aField) const;
00309
00315 IMPORT_C CContactItemField* CreateFieldL() const;
00316
00322 TBool IsEqualLabel(const CContactItemField& aField) const;
00323
00330 TBool IsEqualType(const CContactItemField& aField) const;
00331
00339 IMPORT_C TBool IsEqualTo(const CContactItemField& aField) const;
00340
00349 IMPORT_C TInt CompareOrdering(const CPbkFieldInfo& aOther) const;
00350
00355 IMPORT_C const CPbkFieldInfoGroup* Group() const;
00356
00361 IMPORT_C TPbkFieldLocation Location() const;
00362
00367 IMPORT_C TPbkVersitStorageType VersitStorageType() const;
00368
00374 IMPORT_C void AddToViewDefL(CContactItemViewDef& aViewDef) const;
00375
00381 IMPORT_C void AddToFieldDefL(CContactItemFieldDef& aFieldDef) const;
00382
00387 IMPORT_C const TDesC& AddItemText() const;
00388
00393 IMPORT_C TBool IsReadingField() const;
00394
00395 private:
00396 class TPbkFieldInfoParams;
00397
00398 private:
00399 CPbkFieldInfo();
00400
00401 static CPbkFieldInfo* NewLC(TResourceReader& aReaderStd, TResourceReader& aReaderAdd,
00402 TPbkFieldInfoParams& aPbkFieldInfoParams);
00403
00404 ~CPbkFieldInfo();
00405 void ReadCntModelFieldsL(TResourceReader& aReaderStd);
00406 void ReadAdditionalFieldsL(TResourceReader& aReaderAdd,
00407 TPbkFieldInfoParams& aPbkFieldInfoParams);
00408 void ReadImportPropertiesL(TResourceReader& aReaderAdd);
00409 void ConstructFromResourceL
00410 (TResourceReader& aReaderStd, TResourceReader& aReaderAdd,
00411 TPbkFieldInfoParams& aPbkFieldInfoParams);
00412 TInt ImportPropertyCount() const;
00413 void UpdateTypeUidMapL(CPbkUidMap& aTypeUidMap) const;
00414 void CalculateTypeSignatures(const CPbkUidMap& aTypeUidMap);
00415 TBool IsEqualFlags(const CContactItemField& aField) const;
00416
00417 private:
00418
00419 struct TPbkFieldInfoParams
00420 {
00422 TInt iEditorMaxNumberLength;
00423 };
00424
00425 private:
00430
00431 TStorageType iFieldStorageType;
00433 CContentType* iContentType;
00434
00435
00437 TInt iCategory;
00439 HBufC* iFieldName;
00441 TUint iFlags;
00442
00447
00448 HBufC* iAddItemText;
00450 TUint iAddFlags;
00452 TInt16 iMaxLength;
00454 TInt8 iIconId;
00456 TInt8 iFieldId;
00458 TInt8 iMultiplicity;
00460 TInt8 iEditMode;
00462 TInt8 iDefaultCase;
00464 TInt8 iCtrlType;
00466 TInt8 iOrderingGroup;
00468 TInt8 iOrderingItem;
00470 TInt8 iAddItemOrdering;
00472 TInt8 iLocation;
00473
00474 TInt8 iVersitStorageType;
00475
00477 CPbkFieldImportType* iImportType;
00478
00479 union
00480 {
00482 TPbkFieldGroupId iGroupId;
00484 const CPbkFieldInfoGroup* iGroup;
00485 } iGroupLink;
00486
00487 private:
00488 friend class CPbkFieldsInfo;
00489 friend class PbkFieldInfoWrite;
00490 };
00491
00492
00493 #endif
00494
00495