epoc32/include/cntfldst.h
branchSymbian2
changeset 3 e1b950c65cb4
parent 2 2fe1408b6811
child 4 837f303aceeb
     1.1 --- a/epoc32/include/cntfldst.h	Tue Mar 16 16:12:26 2010 +0000
     1.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.3 @@ -1,191 +0,0 @@
     1.4 -// Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
     1.5 -// All rights reserved.
     1.6 -// This component and the accompanying materials are made available
     1.7 -// 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
     1.8 -// which accompanies this distribution, and is available
     1.9 -// at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
    1.10 -//
    1.11 -// Initial Contributors:
    1.12 -// Nokia Corporation - initial contribution.
    1.13 -//
    1.14 -// Contributors:
    1.15 -//
    1.16 -// Description:
    1.17 -//
    1.18 -
    1.19 -#if !defined(__CNTFLDST_H__)
    1.20 -#define __CNTFLDST_H__
    1.21 -
    1.22 -#if !defined(__E32BASE_H__)
    1.23 -#include <e32base.h>
    1.24 -#endif
    1.25 -
    1.26 -#if !defined(__BAMDESCA_H__)
    1.27 -#include <bamdesca.h>
    1.28 -#endif
    1.29 -
    1.30 -#if !defined(__S32STD_H__)
    1.31 -#include <s32std.h>
    1.32 -#endif
    1.33 -
    1.34 -#if !defined(__CNTDEF_H__)
    1.35 -#include <cntdef.h>
    1.36 -#endif
    1.37 -#define KTextStreamSeparator 0x00
    1.38 -
    1.39 -
    1.40 -
    1.41 -class CStreamStore;
    1.42 -
    1.43 -class CContactFieldStorage : public CBase
    1.44 -/** Abstract base class for the different types of contact field data storage. 
    1.45 -
    1.46 -CContactTextField, CContactStoreField, CContactAgentField, CContactDateField 
    1.47 -and CContactNumberField are all derived from this class.
    1.48 -
    1.49 -A pointer to the base class can be obtained by calling CContactItemField::Storage(). 
    1.50 -Pointers to the derived classes can be retrieved by calling CContactItemField::TextStorage(), 
    1.51 -CContactItemField::StoreStorage() etc. 
    1.52 -@publishedAll
    1.53 -@released
    1.54 -*/
    1.55 -	{
    1.56 -public:
    1.57 -	/** Internalises the field data.
    1.58 -	
    1.59 -	@param aStream Stream from which the the contents of the field should be internalised. */
    1.60 -    virtual void InternalizeL( RReadStream& aStream)=0;
    1.61 -	/** Externalises the field data.
    1.62 -	
    1.63 -	@param aStream Write stream to which the contents of the field should be externalised. */
    1.64 -    virtual void ExternalizeL(RWriteStream& aStream) const=0;
    1.65 -	/** Stores the field data.
    1.66 -	
    1.67 -	@param aStore Reference to the stream store to which the field data is written.
    1.68 -	@return The ID of the stream store. */
    1.69 -	virtual TStreamId StoreL(CStreamStore& aStore) const=0;
    1.70 -	/** Restores the field data.
    1.71 -	
    1.72 -	@param aStore Reference to the store from which the object is to be restored.
    1.73 -	@param aStream Reference to the stream which should be passed to InternalizeL(). */
    1.74 -	virtual void RestoreL(CStreamStore& aStore,RReadStream& aStream)=0;
    1.75 -	/** Tests whether the field storage contains data.
    1.76 -	
    1.77 -	@return True if the field storage contains data, false if not. */
    1.78 -	virtual TBool IsFull() const=0;
    1.79 -private:
    1.80 -	IMPORT_C virtual void CContactFieldStorage_Reserved1();
    1.81 -	TAny* CContactFieldStorage_Reserved;
    1.82 -	};
    1.83 -
    1.84 -class CContactTextField : public CContactFieldStorage
    1.85 -/** Provides access to the text stored in a contact item field. 
    1.86 -
    1.87 -An object of this class can be retrieved using CContactItemField::TextStorage(). 
    1.88 -@publishedAll
    1.89 -@released
    1.90 -*/
    1.91 -	{
    1.92 -public:
    1.93 -	IMPORT_C ~CContactTextField();
    1.94 -public: 
    1.95 -	void InternalizeL(HBufC *aTextStream,TInt aTextFieldIndex);
    1.96 -	void InternalizeL(RReadStream& aStream);
    1.97 -	void ExternalizeL(RWriteStream& aStream) const;
    1.98 -    void ExternalizeL(RWriteStream& aStream,TBool aIsInlineBlob,TInt aTextFieldIndex) const;
    1.99 -	TStreamId StoreL(CStreamStore& aStore) const;
   1.100 -	void RestoreL(CStreamStore& aStore,RReadStream& aStream);
   1.101 -	IMPORT_C void SetTextL(const TDesC& aText);
   1.102 -	IMPORT_C void SetText(HBufC *aHbuf);
   1.103 -	IMPORT_C void SetTextArray(MDesCArray* anArray);
   1.104 -	IMPORT_C TPtrC Text() const;
   1.105 -	TBool IsFull() const;
   1.106 -	IMPORT_C TPtrC StandardTextLC() const;
   1.107 -	IMPORT_C void SetStandardTextL(const TDesC& aText);
   1.108 -	IMPORT_C void SetStandardTextArray(MDesCArray* anArray);
   1.109 -private:
   1.110 -	HBufC *EncodeL(const TDesC& aText,TUid aConversion) const;
   1.111 -	IMPORT_C /*virtual*/ void CContactFieldStorage_Reserved1();
   1.112 -private:
   1.113 -	HBufC* iText;
   1.114 -	};
   1.115 -
   1.116 -class CContactStoreField : public CContactFieldStorage
   1.117 -/** Provides access to the binary field data stored in an 8-bit descriptor. 
   1.118 -
   1.119 -An object of this class can be retrieved using CContactItemField::StoreStorage(). 
   1.120 -@publishedAll
   1.121 -@released
   1.122 -*/
   1.123 -	{
   1.124 -public:
   1.125 -	~CContactStoreField();
   1.126 -	TStreamId StoreL(CStreamStore& aStore) const;
   1.127 -	void RestoreL(CStreamStore& aStore,RReadStream& aStream);
   1.128 -	IMPORT_C void SetThingL(const TDesC8& aDes);
   1.129 -	IMPORT_C void SetThingL(const HBufC8& aDes);
   1.130 -	IMPORT_C void SetThingL(const CBufBase* aBuf);
   1.131 -	IMPORT_C HBufC8* Thing() const; 
   1.132 -	void InternalizeL(RReadStream& aStream);
   1.133 -    void ExternalizeL(RWriteStream& aStream) const;
   1.134 -	TBool IsFull() const;
   1.135 -private:
   1.136 -	IMPORT_C /*virtual*/ void CContactFieldStorage_Reserved1();
   1.137 -private:
   1.138 -	HBufC8* iThing;
   1.139 -	};
   1.140 -
   1.141 -class CContactAgentField : public CContactFieldStorage
   1.142 -/** Provides access to an agent ID. 
   1.143 -
   1.144 -An agent is a field in a contact item which contains another person's 
   1.145 -contact details. It corresponds to the agent property in the vCard 
   1.146 -specification (version 2.1). The agent is identified by an agent ID 
   1.147 -(a TContactItemId).
   1.148 -
   1.149 -An object of this class can be retrieved using CContactItemField::AgentStorage(). 
   1.150 -@publishedAll
   1.151 -@released
   1.152 -*/
   1.153 -	{
   1.154 -public:
   1.155 -	TStreamId StoreL(CStreamStore& aStore) const;
   1.156 -	void RestoreL(CStreamStore& aStore,RReadStream& aStream);
   1.157 -	IMPORT_C void SetAgentId(TContactItemId aId);
   1.158 -	IMPORT_C TContactItemId Value() const;
   1.159 -	void InternalizeL( RReadStream& aStream);
   1.160 -    void ExternalizeL(RWriteStream& aStream) const;
   1.161 -	TBool IsFull() const;
   1.162 -private:
   1.163 -	IMPORT_C /*virtual*/ void CContactFieldStorage_Reserved1();
   1.164 -private:
   1.165 -	TContactItemId iAgentId;
   1.166 -	};
   1.167 -
   1.168 -class CContactDateField : public CContactFieldStorage
   1.169 -/** Provides access to the date/time value stored in a contact item field. 
   1.170 -
   1.171 -An object of this class can be retrieved using CContactItemField::DateTimeStorage(). 
   1.172 -@publishedAll
   1.173 -@released
   1.174 -*/
   1.175 -	{
   1.176 -public:
   1.177 -	CContactDateField();
   1.178 -	TStreamId StoreL(CStreamStore& aStore) const;
   1.179 -	void RestoreL(CStreamStore& aStore,RReadStream& aStream);
   1.180 -	IMPORT_C void SetTime(TTime aTime);
   1.181 -	IMPORT_C void SetTime(TDateTime aDateTime);
   1.182 -	IMPORT_C TTime Time() const;
   1.183 -	void InternalizeL( RReadStream& aStream);
   1.184 -    void ExternalizeL(RWriteStream& aStream) const;
   1.185 -	TBool IsFull() const;
   1.186 -private:
   1.187 -	IMPORT_C /*virtual*/ void CContactFieldStorage_Reserved1();
   1.188 -private:
   1.189 -	TTime iTime;
   1.190 -	};
   1.191 -
   1.192 -
   1.193 -
   1.194 -#endif