1.1 --- a/epoc32/include/vcard.h Tue Mar 16 16:12:26 2010 +0000
1.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
1.3 @@ -1,183 +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 -#ifndef __VCARD_H__
1.20 -#define __VCARD_H__
1.21 -
1.22 -#ifndef __VERSIT_H__
1.23 -#include <versit.h>
1.24 -#endif
1.25 -
1.26 -#include <vobserv.h>
1.27 -
1.28 -_LIT(KVersitTokenVCardVersionNo, "2.1");
1.29 -
1.30 -class CVCard3ParserPlugIn;
1.31 -
1.32 -//
1.33 -// CParserVCard
1.34 -//
1.35 -class CParserVCard : public CVersitParser
1.36 -/** A vCard parser.
1.37 -
1.38 -Adds support for property groups (see CParserGroupedProperty) and agents
1.39 -(see CParserPropertyValueAgent) to the functionality of CVersitParser.
1.40 -
1.41 -Provides a constructor and overrides CVersitParser::InternalizeL(),
1.42 -ExternalizeL(), RecognizeToken(), ConvertAllPropertyDateTimesToMachineLocalL(),
1.43 -ParsePropertyL() and MakePropertyValueL().
1.44 -
1.45 -The vCard data is read from or written to a stream or file, using the InternalizeL()
1.46 -and ExternalizeL() functions. Most users of this class will only need to use
1.47 -these functions.
1.48 -
1.49 -If you are sequentially creating and destroying multiple parsers, a major performance
1.50 -improvement may be achieved by using thread local storage to store an instance of
1.51 -CVersitUnicodeUtils which persists and can be used by all of the parsers.
1.52 -
1.53 -See CVersitTlsData for more information.
1.54 -@publishedAll
1.55 -@released
1.56 -*/
1.57 - {
1.58 -public:
1.59 - IMPORT_C static CParserVCard* NewL();
1.60 - IMPORT_C CArrayPtr<CParserProperty>* GroupOfPropertiesL(const TDesC8& aName) const;
1.61 -public: //from CVersitParser
1.62 - IMPORT_C void InternalizeL(RReadStream& aStream);
1.63 - IMPORT_C void ExternalizeL(RWriteStream& aStream);
1.64 - IMPORT_C void ConvertAllPropertyDateTimesToMachineLocalL(const TTimeIntervalSeconds& aIncrement,const CVersitDaylight* aDaylight);
1.65 -protected:
1.66 - IMPORT_C virtual CParserPropertyValue* MakePropertyValueAgentL(TPtr16 aValue);
1.67 - IMPORT_C CDesC8Array* GetGroupNamesL(TPtr8& aGroupsAndName);
1.68 -protected: // from CVersitParser
1.69 - IMPORT_C void ParsePropertyL();
1.70 - IMPORT_C CParserPropertyValue* MakePropertyValueL(const TUid& aPropertyUid,HBufC16*& aValue);
1.71 - IMPORT_C CParserPropertyValue* MakePropertyValueSoundL(HBufC16*& aValue);
1.72 -public: //from CVersitParser
1.73 - IMPORT_C TUid RecognizeToken(const TDesC8& aToken) const;
1.74 - IMPORT_C void ConvertDateTimesToMachineLocalAndDeleteTZL();
1.75 -protected:
1.76 - CParserVCard();
1.77 -private: // from CVersitParser
1.78 - IMPORT_C virtual void Reserved1();
1.79 - IMPORT_C virtual void Reserved2();
1.80 - };
1.81 -
1.82 -NONSHARABLE_CLASS(CParserVCard3) : public CParserVCard
1.83 -/** A vCard 3.0 parser.
1.84 -
1.85 -Overrides CParserVCard::InternalizeL(). Internalizing of vCard 3.0
1.86 -objects is not supported
1.87 -
1.88 -@internalTechnology
1.89 -@prototype
1.90 -*/
1.91 - {
1.92 -public:
1.93 - IMPORT_C static CParserVCard3* NewL();
1.94 - ~CParserVCard3();
1.95 -
1.96 -public: //from CParserVCard
1.97 - IMPORT_C void InternalizeL(RReadStream& aStream);
1.98 -
1.99 -private:
1.100 - CParserVCard3();
1.101 - void ConstructL();
1.102 - void CreateParserPlugInL();
1.103 -
1.104 -private:
1.105 - CVCard3ParserPlugIn* iPlugInImpl;
1.106 - };
1.107 -
1.108 -//
1.109 -// CParserGroupedProperty
1.110 -//
1.111 -class CParserGroupedProperty : public CParserProperty
1.112 -/** A grouped property.
1.113 -
1.114 -This is a vCard property which may be a member of one or more property groups.
1.115 -It owns an array of descriptors, each of which identifies a group
1.116 -to which the property belongs.
1.117 -
1.118 -An example of how grouped properties may be useful is for a person with two
1.119 -homes. Each home has an address and telephone number, both of which are to
1.120 -be stored on the vCard. The address and telephone number are grouped for each
1.121 -home. A prefix for the address and telephone number properties is provided:
1.122 -one for each home. Each prefix is stored as a property group.
1.123 -
1.124 -When the property is externalised, the identities of all the groups to which
1.125 -the property belongs (i.e. the prefixes) are written to the stream before
1.126 -CParserProperty::ExternalizeL() is called.
1.127 -
1.128 -The class also provides a function which can be used to test whether
1.129 -the property is a member of a given group.
1.130 -
1.131 -Note that the vCard parser stores all properties using this class; if the
1.132 -vCard property is not grouped then the array of property groups is empty.
1.133 -Conversely, the vCalender parser does not have property groups, and so stores
1.134 -all properties using the CParserProperty base class.
1.135 -@publishedAll
1.136 -@released
1.137 -*/
1.138 - {
1.139 -public:
1.140 - IMPORT_C static CParserGroupedProperty* NewL(CParserPropertyValue& aPropertyValue, const TDesC8& aName, CDesC8Array* aArrayOfGroups, CArrayPtr<CParserParam>* aArrayOfParams);
1.141 - IMPORT_C CParserGroupedProperty(CDesC8Array* aArrayOfGroups, CArrayPtr<CParserParam>* aArrayOfParams);
1.142 - IMPORT_C ~CParserGroupedProperty();
1.143 - IMPORT_C TBool Group(const TDesC8& aGroup) const;
1.144 - inline void SetGroups(CDesC8Array* aArrayOfGroups);
1.145 - inline const CDesC8Array* Groups();
1.146 -public: //from CParserProperty
1.147 - IMPORT_C TBool SupportsInterface(const TUid& aInterfaceUid) const;
1.148 - IMPORT_C void ExternalizeL(RWriteStream& aStream, CVersitParser* aVersitParser = NULL);
1.149 -protected:
1.150 - CParserGroupedProperty(CParserPropertyValue& aPropertyValue, CDesC8Array* aArrayOfGroups, CArrayPtr<CParserParam>* aArrayOfParams);
1.151 -private: //from CParserProperty
1.152 - IMPORT_C virtual void Reserved();
1.153 -protected:
1.154 - CDesC8Array* iArrayOfGroups;
1.155 - };
1.156 -
1.157 -//
1.158 -// CParserPropertyValueAgent
1.159 -//
1.160 -class CParserPropertyValueAgent : public CParserPropertyValue
1.161 -/** An agent property value parser.
1.162 -
1.163 -An agent property value contains information about a person who is not the
1.164 -main subject of the vCard. It is implemented as a vCard nested within another
1.165 -vCard. The agent's vCard is held in the property value of the parent vCard.
1.166 -
1.167 -The UID for an agent property value is KVCardPropertyAgentUid.
1.168 -@publishedAll
1.169 -@released
1.170 -*/
1.171 - {
1.172 -public:
1.173 - IMPORT_C CParserPropertyValueAgent(CParserVCard* aValue);
1.174 - IMPORT_C ~CParserPropertyValueAgent();
1.175 - inline CParserVCard* Value() const;
1.176 -
1.177 -public: // from CParserPropertyValue
1.178 - IMPORT_C void ExternalizeL(RWriteStream& aStream,const Versit::TEncodingAndCharset& /*aEncodingCharset*/,TInt /*aLengthOutput*/);
1.179 -protected:
1.180 - CParserVCard* iValue;
1.181 -private:
1.182 - };
1.183 -
1.184 -#include <vcard.inl>
1.185 -
1.186 -#endif