xml/xmlfw/inc/matchdata.h
changeset 0 e35f40988205
equal deleted inserted replaced
-1:000000000000 0:e35f40988205
       
     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 "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.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  @file 
       
    20  @publishedAll
       
    21  @released
       
    22 */
       
    23 
       
    24 
       
    25 #ifndef MATCHDATA_H
       
    26 #define MATCHDATA_H
       
    27 
       
    28 #include <e32base.h>
       
    29 #include <s32strm.h>
       
    30 #include <s32mem.h>
       
    31 #include <ecom/implementationinformation.h>
       
    32 
       
    33 namespace Xml
       
    34 {
       
    35 
       
    36 /**
       
    37 The plugin variant string of the default Symbian-provided XML parser plugins.
       
    38 @publishedAll
       
    39 @released
       
    40 */
       
    41 _LIT8(KXmlSymbianPluginVariant, "Symbian");		
       
    42 
       
    43 /**
       
    44 CMatchData class provides detailed parser information for XML framework.
       
    45 Client application should use this class to precisely specify the plugin, 
       
    46 which should be used as a parsing engine in XML framework.
       
    47 
       
    48 @publishedAll
       
    49 @released
       
    50 */
       
    51 
       
    52 NONSHARABLE_CLASS(CMatchData) : public CBase
       
    53 {
       
    54 
       
    55 public:
       
    56 	CMatchData();
       
    57 	~CMatchData();
       
    58 	
       
    59 	IMPORT_C static CMatchData* NewL();
       
    60 	IMPORT_C static CMatchData* NewL(const TDesC8& aPackage);
       
    61 	IMPORT_C static CMatchData* NewLC();
       
    62 	IMPORT_C static CMatchData* NewLC(const TDesC8& aPackage);
       
    63 
       
    64 	IMPORT_C void SetMimeTypeL(const TDesC8& aData);
       
    65 	IMPORT_C const TPtrC8 MimeType() const;
       
    66 
       
    67 	IMPORT_C void SetVariantL(const TDesC8& aVariant);
       
    68 	IMPORT_C const TPtrC8 Variant() const;
       
    69 	
       
    70 	IMPORT_C void SetLeaveOnMany(TBool aSetting);
       
    71 	IMPORT_C void SetRomOnly(TBool aSetting);
       
    72 	IMPORT_C void SetCaseSensitivity(TBool aSetting);
       
    73 	
       
    74 	IMPORT_C TUid ResolveL(RImplInfoArray& aImplList) const;
       
    75 
       
    76 public:
       
    77 	CMatchData& operator=(const CMatchData & aMatchData);
       
    78 	TBool operator==(const CMatchData & aMatchData) const;
       
    79 	HBufC8* PackToBufferL() const;
       
    80 
       
    81 private:
       
    82 	void ConstructL(const TDesC8& aPackage);
       
    83 	
       
    84 	TBool VariantMatch(const TDesC8& aOpaqueField) const;
       
    85 	TBool MimeTypeMatch(const TDesC8& aDataField) const;
       
    86 	TBool MatchField(const TDesC8& aField, const TDesC8& aMatchString, const TDesC8& aSeparator) const;
       
    87 	
       
    88 	TBool CaseSensitivity() const;
       
    89 	TBool LeaveOnMany() const;
       
    90 	TBool RomOnly() const;
       
    91 	
       
    92 	void ExternalizeL(RWriteStream& aStream) const;
       
    93 	void InternalizeL(RReadStream& aStream);		
       
    94 
       
    95 	TUid SelectSingleParserL(RImplInfoPtrArray& aImplList) const;
       
    96 	TBool IsInvalidVariant() const;
       
    97 	
       
    98 	static TInt SortOrder(const CImplementationInformation &aImpInfo1, 
       
    99 							const CImplementationInformation &aImpInfo2);
       
   100 private:
       
   101 	/** 
       
   102 	Mime type requested by client
       
   103 	Is matched against one of entries of data_type field in resoure information file
       
   104 	*/
       
   105 	HBufC8* iMimeType; 
       
   106 	
       
   107 	/**
       
   108 	Variant requested by client
       
   109 	Is matched against first entry in opaque_data field of resource information file
       
   110 	*/
       
   111 	HBufC8* iVariant;
       
   112 	
       
   113 	/**
       
   114 	Additional information for resolution constrains. Bitmap.
       
   115 	*/
       
   116 	TUint32 iAddInfo;
       
   117 };
       
   118 
       
   119 }
       
   120 #endif // MATCHDATA_H
       
   121 
       
   122