epoc32/include/xml/matchdata.h
author William Roberts <williamr@symbian.org>
Tue, 16 Mar 2010 16:12:26 +0000
branchSymbian2
changeset 2 2fe1408b6811
parent 0 061f57f2323e
child 4 837f303aceeb
permissions -rw-r--r--
Final list of Symbian^2 public API header files
     1 // Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies).
     2 // All rights reserved.
     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
     5 // which accompanies this distribution, and is available
     6 // at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
     7 //
     8 // Initial Contributors:
     9 // Nokia Corporation - initial contribution.
    10 //
    11 // Contributors:
    12 //
    13 // Description:
    14 // Detailed parser information for resolution criteria in XML framework
    15 // 
    16 //
    17 
    18 
    19 
    20 /**
    21  @file 
    22  @publishedAll
    23  @released
    24 */
    25 
    26 
    27 #ifndef MATCHDATA_H
    28 #define MATCHDATA_H
    29 
    30 #include <e32base.h>
    31 #include <s32strm.h>
    32 #include <s32mem.h>
    33 #include <ecom/implementationinformation.h>
    34 
    35 namespace Xml
    36 {
    37 
    38 /**
    39 The plugin variant string of the default Symbian-provided XML parser plugins.
    40 @publishedAll
    41 @released
    42 */
    43 _LIT8(KXmlSymbianPluginVariant, "Symbian");		
    44 
    45 /**
    46 CMatchData class provides detailed parser information for XML framework.
    47 Client application should use this class to precisely specify the plugin, 
    48 which should be used as a parsing engine in XML framework.
    49 
    50 @publishedAll
    51 @released
    52 */
    53 
    54 NONSHARABLE_CLASS(CMatchData) : public CBase
    55 {
    56 
    57 public:
    58 	CMatchData();
    59 	~CMatchData();
    60 	
    61 	IMPORT_C static CMatchData* NewL();
    62 	IMPORT_C static CMatchData* NewL(const TDesC8& aPackage);
    63 	IMPORT_C static CMatchData* NewLC();
    64 	IMPORT_C static CMatchData* NewLC(const TDesC8& aPackage);
    65 
    66 	IMPORT_C void SetMimeTypeL(const TDesC8& aData);
    67 	IMPORT_C const TPtrC8 MimeType() const;
    68 
    69 	IMPORT_C void SetVariantL(const TDesC8& aVariant);
    70 	IMPORT_C const TPtrC8 Variant() const;
    71 	
    72 	IMPORT_C void SetLeaveOnMany(TBool aSetting);
    73 	IMPORT_C void SetRomOnly(TBool aSetting);
    74 	IMPORT_C void SetCaseSensitivity(TBool aSetting);
    75 	
    76 	IMPORT_C TUid ResolveL(RImplInfoArray& aImplList) const;
    77 
    78 public:
    79 	CMatchData& operator=(const CMatchData & aMatchData);
    80 	TBool operator==(const CMatchData & aMatchData) const;
    81 	HBufC8* PackToBufferL() const;
    82 
    83 private:
    84 	void ConstructL(const TDesC8& aPackage);
    85 	
    86 	TBool VariantMatch(const TDesC8& aOpaqueField) const;
    87 	TBool MimeTypeMatch(const TDesC8& aDataField) const;
    88 	TBool MatchField(const TDesC8& aField, const TDesC8& aMatchString, const TDesC8& aSeparator) const;
    89 	
    90 	TBool CaseSensitivity() const;
    91 	TBool LeaveOnMany() const;
    92 	TBool RomOnly() const;
    93 	
    94 	void ExternalizeL(RWriteStream& aStream) const;
    95 	void InternalizeL(RReadStream& aStream);		
    96 
    97 	TUid SelectSingleParserL(RImplInfoPtrArray& aImplList) const;
    98 	TBool IsInvalidVariant() const;
    99 	
   100 	static TInt SortOrder(const CImplementationInformation &aImpInfo1, 
   101 							const CImplementationInformation &aImpInfo2);
   102 private:
   103 	/** 
   104 	Mime type requested by client
   105 	Is matched against one of entries of data_type field in resoure information file
   106 	*/
   107 	HBufC8* iMimeType; 
   108 	
   109 	/**
   110 	Variant requested by client
   111 	Is matched against first entry in opaque_data field of resource information file
   112 	*/
   113 	HBufC8* iVariant;
   114 	
   115 	/**
   116 	Additional information for resolution constrains. Bitmap.
   117 	*/
   118 	TUint32 iAddInfo;
   119 };
   120 
   121 }
   122 #endif // MATCHDATA_H