epoc32/include/app/cntfield.h
branchSymbian3
changeset 4 837f303aceeb
parent 3 e1b950c65cb4
equal deleted inserted replaced
3:e1b950c65cb4 4:837f303aceeb
     1 // Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
     1 // Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
     2 // All rights reserved.
     2 // All rights reserved.
     3 // This component and the accompanying materials are made available
     3 // This component and the accompanying materials are made available
     4 // under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
     4 // under the terms of "Eclipse Public License v1.0"
     5 // which accompanies this distribution, and is available
     5 // which accompanies this distribution, and is available
     6 // at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
     7 //
     7 //
     8 // Initial Contributors:
     8 // Initial Contributors:
     9 // Nokia Corporation - initial contribution.
     9 // Nokia Corporation - initial contribution.
    10 //
    10 //
    11 // Contributors:
    11 // Contributors:
    22 
    22 
    23 #include <cntdef.h>
    23 #include <cntdef.h>
    24 
    24 
    25 
    25 
    26 
    26 
       
    27 /** Null field ID.
       
    28 @publishedAll
       
    29 @released
       
    30 */
    27 const TInt KNullFieldId=-1;
    31 const TInt KNullFieldId=-1;
    28 
    32 
    29 //const TInt KIntContactFieldHint???=0x01;
    33 #ifndef SYMBIAN_ENABLE_SPLIT_HEADERS
       
    34 /** @internalComponent */
    30 const TInt KIntContactHintIsPhone=0x02;
    35 const TInt KIntContactHintIsPhone=0x02;
       
    36 /** @internalComponent */
    31 const TInt KIntContactHintIsMsg=0x04;
    37 const TInt KIntContactHintIsMsg=0x04;
       
    38 /** @internalComponent */
    32 const TInt KIntContactHintIsCompanyName=0x08;
    39 const TInt KIntContactHintIsCompanyName=0x08;
       
    40 /** @internalComponent */
    33 const TInt KIntContactHintIsFamilyName=0x10;
    41 const TInt KIntContactHintIsFamilyName=0x10;
       
    42 /** @internalComponent */
    34 const TInt KIntContactHintIsGivenName=0x20;
    43 const TInt KIntContactHintIsGivenName=0x20;
       
    44 /** @internalComponent */
    35 const TInt KIntContactHintIsAddress=0x40;
    45 const TInt KIntContactHintIsAddress=0x40;
       
    46 /** @internalComponent */
    36 const TInt KIntContactHintIsAdditionalName=0x80;
    47 const TInt KIntContactHintIsAdditionalName=0x80;
       
    48 /** @internalComponent */
    37 const TInt KIntContactHintIsSuffixName=0x100;
    49 const TInt KIntContactHintIsSuffixName=0x100;
       
    50 /** @internalComponent */
    38 const TInt KIntContactHintIsPrefixName=0x200;
    51 const TInt KIntContactHintIsPrefixName=0x200;
       
    52 /** @internalComponent */
    39 const TInt KIntContactHintStorageInline=0x400;
    53 const TInt KIntContactHintStorageInline=0x400;
       
    54 /** @internalComponent */
    40 const TInt KIntContactHintIsEmail=0x4000;
    55 const TInt KIntContactHintIsEmail=0x4000;
       
    56 /** @internalComponent */
    41 const TInt KIntContactHintIsPronunciation=0x800;
    57 const TInt KIntContactHintIsPronunciation=0x800;
       
    58 /** @internalComponent */
    42 const TInt KIntContactHintIsCompanyNamePronunciation=KIntContactHintIsPronunciation|KIntContactHintIsCompanyName;
    59 const TInt KIntContactHintIsCompanyNamePronunciation=KIntContactHintIsPronunciation|KIntContactHintIsCompanyName;
       
    60 /** @internalComponent */
    43 const TInt KIntContactHintIsGivenNamePronunciation=KIntContactHintIsPronunciation|KIntContactHintIsGivenName;
    61 const TInt KIntContactHintIsGivenNamePronunciation=KIntContactHintIsPronunciation|KIntContactHintIsGivenName;
       
    62 /** @internalComponent */
    44 const TInt KIntContactHintIsFamilyNamePronunciation=KIntContactHintIsPronunciation|KIntContactHintIsFamilyName;
    63 const TInt KIntContactHintIsFamilyNamePronunciation=KIntContactHintIsPronunciation|KIntContactHintIsFamilyName;
    45 
    64 
       
    65 /** @internalComponent */
    46 const TInt KHintTypeMask = 0x1FFFFF;
    66 const TInt KHintTypeMask = 0x1FFFFF;
    47 
    67 
    48 #ifdef __SYMBIAN_CNTMODEL_USE_SQLITE__
    68 #ifdef __SYMBIAN_CNTMODEL_USE_SQLITE__
    49 const TInt KHintAdditionalMask    = 0x7F000000; //Number of additional type ids.
    69 
    50 const TInt KHintVCardMappingMask  = 0x80000000; //bit flag to show if there is a vCard mapping uid.
    70 /** Number of additional type ids.
    51 const TInt KHintTemplateFieldMask = 0x7FFFFFFF; //Template field mask in low hint value.
    71 @internalComponent 
    52 
    72 */
       
    73 const TInt KHintAdditionalMask    = 0x7F000000;
       
    74 /** Bit flag to show if there is a vCard mapping uid.
       
    75 @internalComponent 
       
    76 */
       
    77 const TInt KHintVCardMappingMask  = 0x80000000;
       
    78 /** Template field mask in low hint value.
       
    79 @internalComponent 
       
    80 */
       
    81 const TInt KHintTemplateFieldMask = 0x7FFFFFFF;
       
    82 
       
    83 /** @internalComponent */
    53 const TInt KHintAdditionalMaskShift = 24;
    84 const TInt KHintAdditionalMaskShift = 24;
    54 
    85 
    55 #else //_SYMBIAN_USE_SQLITE__
    86 #else //_SYMBIAN_USE_SQLITE__
    56 
    87 
       
    88 /** @internalComponent */
    57 const TInt KHintAdditionalMask = 0x200000;
    89 const TInt KHintAdditionalMask = 0x200000;
       
    90 /** @internalComponent */
    58 const TInt KHintIdMask = 0xFFC00000;
    91 const TInt KHintIdMask = 0xFFC00000;
    59 
    92 
    60 #endif //_SYMBIAN_USE_SQLITE__
    93 #endif //_SYMBIAN_USE_SQLITE__
    61 
    94 #endif //SYMBIAN_ENABLE_SPLIT_HEADERS
    62 
    95 
    63 class RWriteStream;
    96 class RWriteStream;
    64 class RReadStream;
    97 class RReadStream;
    65 class CContactFieldStorage;
    98 class CContactFieldStorage;
    66 class CContactTextField;
    99 class CContactTextField;
   171 	friend class CContactItemFieldSet;
   204 	friend class CContactItemFieldSet;
   172 	friend class CContactDatabase;      
   205 	friend class CContactDatabase;      
   173 	friend class CContactTables;
   206 	friend class CContactTables;
   174 	friend class RPplContactTable;
   207 	friend class RPplContactTable;
   175 	friend class CPackagerTests;
   208 	friend class CPackagerTests;
       
   209 #ifdef SYMBIAN_ENABLE_SPLIT_HEADERS
       
   210     class THint;
       
   211 #else
   176 	class THint
   212 	class THint
   177 	/**
   213 	/**
   178 	@internalComponent
   214 	@internalComponent
   179 	@released
   215 	@released
   180 	*/
   216 	*/
   237 #endif //__SYMBIAN_CNTMODEL_USE_SQLITE__		
   273 #endif //__SYMBIAN_CNTMODEL_USE_SQLITE__		
   238 	public:
   274 	public:
   239 		TInt iHintValue;
   275 		TInt iHintValue;
   240 
   276 
   241 		};
   277 		};
       
   278 #endif
   242 		
   279 		
   243 public:
   280 public:
   244 	IMPORT_C static CContactItemField* NewLC();
   281 	IMPORT_C static CContactItemField* NewLC();
   245 	IMPORT_C static CContactItemField* NewL(TStorageType aType);
   282 	IMPORT_C static CContactItemField* NewL(TStorageType aType);
   246 	IMPORT_C static CContactItemField* NewLC(TStorageType aType);
   283 	IMPORT_C static CContactItemField* NewLC(TStorageType aType);
   399 public:
   436 public:
   400 	inline CContactItemFieldDef() : CArrayFixFlat<TUid>(8) 
   437 	inline CContactItemFieldDef() : CArrayFixFlat<TUid>(8) 
   401 	/** Constructs the CContactItemFieldDef object, with an array granularity of 8. */
   438 	/** Constructs the CContactItemFieldDef object, with an array granularity of 8. */
   402 		{};
   439 		{};
   403 	};
   440 	};
   404 
   441 #ifndef SYMBIAN_ENABLE_SPLIT_HEADERS
   405 class TContactFieldAtts
   442 class TContactFieldAtts
   406 /**
   443 /**
   407 @internalComponent
   444 @internalComponent
   408 @released
   445 @released
   409 */
   446 */
   477 	};
   514 	};
   478 
   515 
   479 inline TFieldHeader::TFieldHeader(TStreamId aId,TContactFieldAtts aAtts)
   516 inline TFieldHeader::TFieldHeader(TStreamId aId,TContactFieldAtts aAtts)
   480 	{ iStreamId=aId; iAtts=aAtts; }
   517 	{ iStreamId=aId; iAtts=aAtts; }
   481 #endif //__SYMBIAN_CNTMODEL_USE_SQLITE__
   518 #endif //__SYMBIAN_CNTMODEL_USE_SQLITE__
       
   519 #endif //SYMBIAN_ENABLE_SPLIT_HEADERS
   482 
   520 
   483 inline TBool CContactItemField::IsHidden() const
   521 inline TBool CContactItemField::IsHidden() const
   484 /** Gets the value of the field's hidden attribute.
   522 /** Gets the value of the field's hidden attribute.
   485 
   523 
   486 @return ETrue if hidden attribute is set, EFalse if not set. */
   524 @return ETrue if hidden attribute is set, EFalse if not set. */
   525 inline TBool CContactItemField::IsDeleted() const
   563 inline TBool CContactItemField::IsDeleted() const
   526 /** Gets the value of the field's deleted  attribute.
   564 /** Gets the value of the field's deleted  attribute.
   527 
   565 
   528 @return ETrue if the field is deleted, otherwise EFalse.                            */
   566 @return ETrue if the field is deleted, otherwise EFalse.                            */
   529 	{ return iAttributes&EDeleted; }
   567 	{ return iAttributes&EDeleted; }
   530 
   568 #ifndef SYMBIAN_ENABLE_SPLIT_HEADERS
   531 inline void CContactItemField::THint::SetIsPhone()
   569 inline void CContactItemField::THint::SetIsPhone()
   532 	{iHintValue|=KIntContactHintIsPhone;}
   570 	{iHintValue|=KIntContactHintIsPhone;}
   533 inline void CContactItemField::THint::SetIsMsg()
   571 inline void CContactItemField::THint::SetIsMsg()
   534 	{iHintValue|=KIntContactHintIsMsg;}
   572 	{iHintValue|=KIntContactHintIsMsg;}
   535 // turn off Pronunciation bit too?
   573 // turn off Pronunciation bit too?
   590 inline void CContactItemField::THint::SetHasAdditionalUids()
   628 inline void CContactItemField::THint::SetHasAdditionalUids()
   591 	{iHintValue|=KHintAdditionalMask;}
   629 	{iHintValue|=KHintAdditionalMask;}
   592 #endif //__SYMBIAN_CNTMODEL_USE_SQLITE__ 
   630 #endif //__SYMBIAN_CNTMODEL_USE_SQLITE__ 
   593 inline TBool CContactItemField::THint::Contains(const THint& aHint) const
   631 inline TBool CContactItemField::THint::Contains(const THint& aHint) const
   594 	{return (iHintValue&aHint.iHintValue);}
   632 	{return (iHintValue&aHint.iHintValue);}
   595 
   633 #endif
   596 inline TBool CContactItemField::OverRidesLabel() const
   634 inline TBool CContactItemField::OverRidesLabel() const
   597 /** Tests whether the field's label (as set by SetLabel()) overrides the label 
   635 /** Tests whether the field's label (as set by SetLabel()) overrides the label 
   598 specified in the field's template.
   636 specified in the field's template.
   599 
   637 
   600 @return True if the field's label overrides the label specified in the template; 
   638 @return True if the field's label overrides the label specified in the template;