tpbkcontactitemfield.h

Go to the documentation of this file.
00001 /*
00002 * ============================================================================
00003 *  Name     : TPbkContactItemField.h
00004 *  Part of  : PbkEng.dll
00005 *
00006 *  Description:
00007 *     This class extends Symbian Contacts model CContactItemField class capabilities
00008 *         to better suit Phonebook's needs.
00009 *  Version:
00010 *
00011 *  Copyright (C) 2002 Nokia Corporation.
00012 *  This material, including documentation and any related 
00013 *  computer programs, is protected by copyright controlled by 
00014 *  Nokia Corporation. All rights are reserved. Copying, 
00015 *  including reproducing, storing,  adapting or translating, any 
00016 *  or all of this material requires the prior written consent of 
00017 *  Nokia Corporation. This material also contains confidential 
00018 *  information which may not be disclosed to others without the 
00019 *  prior written consent of Nokia Corporation.
00020 * ============================================================================
00021 */
00022 
00023 #ifndef __TPbkContactItemField_H__
00024 #define __TPbkContactItemField_H__
00025 
00026 //  INCLUDES
00027 #include    <e32std.h>
00028 #include    "MPbkFieldData.h"
00029 #include    <cntdef.h>  // TStorageType
00030 #include    "PbkIconId.hrh"
00031 
00032 // These two includes are not needed here anymore
00033 // and might be removed in the future
00034 #include    <cntitem.h> // CContactItem
00035 #include    <cntfldst.h> // CContactItemField storage types
00036 
00037 
00038 // FORWARD DECLARATIONS
00039 class CPbkFieldInfo;
00040 class CContactItemField;
00041 class CContactTextField;
00042 class CPbkContactItem;
00043 class CContactDateField;
00044 
00045 
00046 // CLASS DECLARATION
00047 
00053 class TPbkContactItemField : public MPbkFieldData
00054     {
00055     public:  // Constructors and destructor
00059         IMPORT_C TPbkContactItemField();
00060 
00067         IMPORT_C TPbkContactItemField(CContactItemField* aField,
00068                         CPbkFieldInfo* aFieldInfo);
00069 
00075         IMPORT_C void Set(CContactItemField* aField,
00076                         CPbkFieldInfo* aFieldInfo);
00077 
00078     public: // New functions
00083         IMPORT_C TPbkIconId IconId() const;
00084 
00089         IMPORT_C CPbkFieldInfo& FieldInfo() const;
00090 
00096         IMPORT_C TPtrC Text() const;
00097 
00103         IMPORT_C TTime Time() const;
00104 
00115         IMPORT_C void GetTextL(TDes& aText) const;
00116 
00121         IMPORT_C TStorageType StorageType() const;
00122 
00127         IMPORT_C CContactItemField& ItemField() const;
00128 
00134         IMPORT_C CContactTextField* TextStorage() const;
00135 
00140         IMPORT_C TPtrC Label() const;
00141 
00146         IMPORT_C void SetLabelL(const TDesC& aLabel);
00147 
00152         IMPORT_C void SetHidden(TBool aHidden);
00153 
00158         IMPORT_C TBool IsHidden() const;
00159 
00165         IMPORT_C CContactDateField* DateTimeStorage() const;
00166 
00171         IMPORT_C TBool IsSame(const TPbkContactItemField& aField) const;
00172 
00177         IMPORT_C CContactItemField& ContactItemField();
00178 
00183         IMPORT_C const CContactItemField& ContactItemField() const;
00184 
00189         IMPORT_C TInt Compare(const TPbkContactItemField& aRhs) const;
00190 
00197         IMPORT_C TInt UniqueFieldIdentity() const;
00198 
00203         IMPORT_C TBool IsEmpty() const;
00204         
00209         IMPORT_C TBool IsEmptyOrAllSpaces() const;
00210 
00217         IMPORT_C TBool DefaultPhoneNumberField() const;
00218         
00225         IMPORT_C TBool DefaultVideoNumberField() const;
00226 
00233         IMPORT_C TBool DefaultSmsField() const;
00234 
00241         IMPORT_C TBool DefaultEmailOverSmsField() const;
00242 
00249         IMPORT_C TBool DefaultEmailField() const;
00250 
00257         IMPORT_C TBool DefaultMmsField() const;
00258 
00265         IMPORT_C TBool DefaultPocField() const;
00266         
00273         IMPORT_C TBool DefaultVoipField() const;
00274 
00281         IMPORT_C CArrayFix<TInt>* SpeedDialIndexesL() const;
00282 
00283     public:  // from MPbkFieldData
00284         IMPORT_C TStorageType PbkFieldType() const;
00285         IMPORT_C TPbkFieldId PbkFieldId() const;
00286         IMPORT_C TPtrC PbkFieldText() const;
00287         IMPORT_C TTime PbkFieldTime() const;
00288         
00289     private: // CPbkContactItem support functions
00291         friend class CPbkContactItem;
00292         void PrepareForSaveL();
00293         void PrepareAfterLoadL();
00294         TBool HasInvalidDate();
00295 
00296     private:    // Data
00298         CContactItemField* iField;
00300         CPbkFieldInfo* iFieldInfo;
00301 
00302     private:  // Friend declarations
00303         friend IMPORT_C TBool operator==
00304             (const TPbkContactItemField& aLeft, 
00305             const TPbkContactItemField& aRight);
00306     };
00307 
00308 
00309 // FUNCTION DECLARATIONS
00310 
00317 IMPORT_C TBool operator==
00318     (const TPbkContactItemField& aLeft, 
00319     const TPbkContactItemField& aRight);
00320 
00324 inline TBool operator!=
00325     (const TPbkContactItemField& aLeft, 
00326     const TPbkContactItemField& aRight)
00327     {
00328     return !(aLeft==aRight);
00329     }
00330 
00331 
00332 // __TPbkContactItemField_H__
00333 #endif
00334             
00335 // End of File

Copyright © Nokia Corporation 2001-2008
Back to top