epoc32/include/app/cntfldst.h
author William Roberts <williamr@symbian.org>
Wed, 31 Mar 2010 12:33:34 +0100
branchSymbian3
changeset 4 837f303aceeb
parent 3 e1b950c65cb4
permissions -rw-r--r--
Current Symbian^3 public API header files (from PDK 3.0.h)
This is the epoc32/include tree with the "platform" subtrees removed, and
all but a selected few mbg and rsg files removed.
williamr@2
     1
// Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
williamr@2
     2
// All rights reserved.
williamr@2
     3
// This component and the accompanying materials are made available
williamr@4
     4
// under the terms of "Eclipse Public License v1.0"
williamr@2
     5
// which accompanies this distribution, and is available
williamr@4
     6
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
williamr@2
     7
//
williamr@2
     8
// Initial Contributors:
williamr@2
     9
// Nokia Corporation - initial contribution.
williamr@2
    10
//
williamr@2
    11
// Contributors:
williamr@2
    12
//
williamr@2
    13
// Description:
williamr@2
    14
//
williamr@2
    15
williamr@2
    16
#if !defined(__CNTFLDST_H__)
williamr@2
    17
#define __CNTFLDST_H__
williamr@2
    18
williamr@2
    19
#if !defined(__E32BASE_H__)
williamr@2
    20
#include <e32base.h>
williamr@2
    21
#endif
williamr@2
    22
williamr@2
    23
#if !defined(__BAMDESCA_H__)
williamr@2
    24
#include <bamdesca.h>
williamr@2
    25
#endif
williamr@2
    26
williamr@2
    27
#if !defined(__S32STD_H__)
williamr@2
    28
#include <s32std.h>
williamr@2
    29
#endif
williamr@2
    30
williamr@2
    31
#if !defined(__CNTDEF_H__)
williamr@2
    32
#include <cntdef.h>
williamr@2
    33
#endif
williamr@2
    34
#define KTextStreamSeparator 0x00
williamr@2
    35
williamr@2
    36
williamr@2
    37
williamr@2
    38
class CStreamStore;
williamr@2
    39
williamr@2
    40
class CContactFieldStorage : public CBase
williamr@2
    41
/** Abstract base class for the different types of contact field data storage. 
williamr@2
    42
williamr@2
    43
CContactTextField, CContactStoreField, CContactAgentField, CContactDateField 
williamr@2
    44
and CContactNumberField are all derived from this class.
williamr@2
    45
williamr@2
    46
A pointer to the base class can be obtained by calling CContactItemField::Storage(). 
williamr@2
    47
Pointers to the derived classes can be retrieved by calling CContactItemField::TextStorage(), 
williamr@2
    48
CContactItemField::StoreStorage() etc. 
williamr@2
    49
@publishedAll
williamr@2
    50
@released
williamr@2
    51
*/
williamr@2
    52
	{
williamr@2
    53
public:
williamr@2
    54
	/** Internalises the field data.
williamr@2
    55
	
williamr@2
    56
	@param aStream Stream from which the the contents of the field should be internalised. */
williamr@2
    57
    virtual void InternalizeL( RReadStream& aStream)=0;
williamr@2
    58
	/** Externalises the field data.
williamr@2
    59
	
williamr@2
    60
	@param aStream Write stream to which the contents of the field should be externalised. */
williamr@2
    61
    virtual void ExternalizeL(RWriteStream& aStream) const=0;
williamr@2
    62
	/** Stores the field data.
williamr@2
    63
	
williamr@2
    64
	@param aStore Reference to the stream store to which the field data is written.
williamr@2
    65
	@return The ID of the stream store. */
williamr@2
    66
	virtual TStreamId StoreL(CStreamStore& aStore) const=0;
williamr@2
    67
	/** Restores the field data.
williamr@2
    68
	
williamr@2
    69
	@param aStore Reference to the store from which the object is to be restored.
williamr@2
    70
	@param aStream Reference to the stream which should be passed to InternalizeL(). */
williamr@2
    71
	virtual void RestoreL(CStreamStore& aStore,RReadStream& aStream)=0;
williamr@2
    72
	/** Tests whether the field storage contains data.
williamr@2
    73
	
williamr@2
    74
	@return True if the field storage contains data, false if not. */
williamr@2
    75
	virtual TBool IsFull() const=0;
williamr@2
    76
private:
williamr@2
    77
	IMPORT_C virtual void CContactFieldStorage_Reserved1();
williamr@2
    78
	TAny* CContactFieldStorage_Reserved;
williamr@2
    79
	};
williamr@2
    80
williamr@2
    81
class CContactTextField : public CContactFieldStorage
williamr@2
    82
/** Provides access to the text stored in a contact item field. 
williamr@2
    83
williamr@2
    84
An object of this class can be retrieved using CContactItemField::TextStorage(). 
williamr@2
    85
@publishedAll
williamr@2
    86
@released
williamr@2
    87
*/
williamr@2
    88
	{
williamr@2
    89
public:
williamr@2
    90
	IMPORT_C ~CContactTextField();
williamr@2
    91
public: 
williamr@2
    92
	void InternalizeL(HBufC *aTextStream,TInt aTextFieldIndex);
williamr@2
    93
	void InternalizeL(RReadStream& aStream);
williamr@2
    94
	void ExternalizeL(RWriteStream& aStream) const;
williamr@2
    95
    void ExternalizeL(RWriteStream& aStream,TBool aIsInlineBlob,TInt aTextFieldIndex) const;
williamr@2
    96
	TStreamId StoreL(CStreamStore& aStore) const;
williamr@2
    97
	void RestoreL(CStreamStore& aStore,RReadStream& aStream);
williamr@2
    98
	IMPORT_C void SetTextL(const TDesC& aText);
williamr@2
    99
	IMPORT_C void SetText(HBufC *aHbuf);
williamr@2
   100
	IMPORT_C void SetTextArray(MDesCArray* anArray);
williamr@2
   101
	IMPORT_C TPtrC Text() const;
williamr@2
   102
	TBool IsFull() const;
williamr@2
   103
	IMPORT_C TPtrC StandardTextLC() const;
williamr@2
   104
	IMPORT_C void SetStandardTextL(const TDesC& aText);
williamr@2
   105
	IMPORT_C void SetStandardTextArray(MDesCArray* anArray);
williamr@2
   106
private:
williamr@2
   107
	HBufC *EncodeL(const TDesC& aText,TUid aConversion) const;
williamr@2
   108
	IMPORT_C /*virtual*/ void CContactFieldStorage_Reserved1();
williamr@2
   109
private:
williamr@2
   110
	HBufC* iText;
williamr@2
   111
	};
williamr@2
   112
williamr@2
   113
class CContactStoreField : public CContactFieldStorage
williamr@2
   114
/** Provides access to the binary field data stored in an 8-bit descriptor. 
williamr@2
   115
williamr@2
   116
An object of this class can be retrieved using CContactItemField::StoreStorage(). 
williamr@2
   117
@publishedAll
williamr@2
   118
@released
williamr@2
   119
*/
williamr@2
   120
	{
williamr@2
   121
public:
williamr@2
   122
	~CContactStoreField();
williamr@2
   123
	TStreamId StoreL(CStreamStore& aStore) const;
williamr@2
   124
	void RestoreL(CStreamStore& aStore,RReadStream& aStream);
williamr@2
   125
	IMPORT_C void SetThingL(const TDesC8& aDes);
williamr@2
   126
	IMPORT_C void SetThingL(const HBufC8& aDes);
williamr@2
   127
	IMPORT_C void SetThingL(const CBufBase* aBuf);
williamr@2
   128
	IMPORT_C HBufC8* Thing() const; 
williamr@2
   129
	void InternalizeL(RReadStream& aStream);
williamr@2
   130
    void ExternalizeL(RWriteStream& aStream) const;
williamr@2
   131
	TBool IsFull() const;
williamr@2
   132
private:
williamr@2
   133
	IMPORT_C /*virtual*/ void CContactFieldStorage_Reserved1();
williamr@2
   134
private:
williamr@2
   135
	HBufC8* iThing;
williamr@2
   136
	};
williamr@2
   137
williamr@2
   138
class CContactAgentField : public CContactFieldStorage
williamr@2
   139
/** Provides access to an agent ID. 
williamr@2
   140
williamr@2
   141
An agent is a field in a contact item which contains another person's 
williamr@2
   142
contact details. It corresponds to the agent property in the vCard 
williamr@2
   143
specification (version 2.1). The agent is identified by an agent ID 
williamr@2
   144
(a TContactItemId).
williamr@2
   145
williamr@2
   146
An object of this class can be retrieved using CContactItemField::AgentStorage(). 
williamr@2
   147
@publishedAll
williamr@2
   148
@released
williamr@2
   149
*/
williamr@2
   150
	{
williamr@2
   151
public:
williamr@2
   152
	TStreamId StoreL(CStreamStore& aStore) const;
williamr@2
   153
	void RestoreL(CStreamStore& aStore,RReadStream& aStream);
williamr@2
   154
	IMPORT_C void SetAgentId(TContactItemId aId);
williamr@2
   155
	IMPORT_C TContactItemId Value() const;
williamr@2
   156
	void InternalizeL( RReadStream& aStream);
williamr@2
   157
    void ExternalizeL(RWriteStream& aStream) const;
williamr@2
   158
	TBool IsFull() const;
williamr@2
   159
private:
williamr@2
   160
	IMPORT_C /*virtual*/ void CContactFieldStorage_Reserved1();
williamr@2
   161
private:
williamr@2
   162
	TContactItemId iAgentId;
williamr@2
   163
	};
williamr@2
   164
williamr@2
   165
class CContactDateField : public CContactFieldStorage
williamr@2
   166
/** Provides access to the date/time value stored in a contact item field. 
williamr@2
   167
williamr@2
   168
An object of this class can be retrieved using CContactItemField::DateTimeStorage(). 
williamr@2
   169
@publishedAll
williamr@2
   170
@released
williamr@2
   171
*/
williamr@2
   172
	{
williamr@2
   173
public:
williamr@2
   174
	CContactDateField();
williamr@2
   175
	TStreamId StoreL(CStreamStore& aStore) const;
williamr@2
   176
	void RestoreL(CStreamStore& aStore,RReadStream& aStream);
williamr@2
   177
	IMPORT_C void SetTime(TTime aTime);
williamr@2
   178
	IMPORT_C void SetTime(TDateTime aDateTime);
williamr@2
   179
	IMPORT_C TTime Time() const;
williamr@2
   180
	void InternalizeL( RReadStream& aStream);
williamr@2
   181
    void ExternalizeL(RWriteStream& aStream) const;
williamr@2
   182
	TBool IsFull() const;
williamr@2
   183
private:
williamr@2
   184
	IMPORT_C /*virtual*/ void CContactFieldStorage_Reserved1();
williamr@2
   185
private:
williamr@2
   186
	TTime iTime;
williamr@2
   187
	};
williamr@2
   188
williamr@2
   189
williamr@2
   190
williamr@2
   191
#endif