messagingfw/biomsgfw/BIFUINC/BIF.H
changeset 62 db3f5fa34ec7
parent 0 8e480a14352b
child 58 6c34d0baa0b1
equal deleted inserted replaced
60:9f5ae1728557 62:db3f5fa34ec7
       
     1 // Copyright (c) 1997-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 // BIF.H
       
    15 //
       
    16 /**
       
    17  * @file 
       
    18  * BIO information file (BIF)
       
    19  *
       
    20  * @publishedAll
       
    21  * @released
       
    22  */
       
    23 #ifndef __BIF_H__
       
    24 #define __BIF_H__
       
    25 
       
    26 #include <apmrec.h>
       
    27 
       
    28 class CBifEntry;
       
    29 		
       
    30 /** 
       
    31  * Maximum length of ID text field.
       
    32  * @publishedAll
       
    33  * @released
       
    34  */
       
    35 const TInt KMaxBioIdText=128;
       
    36 
       
    37 /** Data types.
       
    38  * Buffer to hold a BIF ID identifier text field.
       
    39  * @publishedAll
       
    40  * @released
       
    41  */
       
    42 typedef TBuf<KMaxBioIdText> TBioMsgIdText;
       
    43 
       
    44 /** Identifies bearers for the BIF ID type field. 
       
    45  * It is the C++ equivalent of the resource enum ID_TYPE.
       
    46  *
       
    47  * @publishedAll
       
    48  * @released
       
    49  */
       
    50 enum TBioMsgIdType 
       
    51 	{
       
    52 	/** Unknown.
       
    53 	
       
    54 	Item will not be used in matching. */
       
    55 	EBioMsgIdUnknown,
       
    56 
       
    57 	/** MIME type.
       
    58 	
       
    59 	Specifies that a bearer that transports MIME messages (e.g. e-mail) should 
       
    60 	match the MIME type against the ID text field. */
       
    61 	EBioMsgIdIana,
       
    62 
       
    63 	/** Narrow band (SMS).
       
    64 	
       
    65 	Specifies that the SMS bearer should match messages against the ID port field. */
       
    66 	EBioMsgIdNbs,
       
    67 
       
    68 	/** WAP WDP.
       
    69 	
       
    70 	Specifies that the WAP bearer should match messages against the ID port field. */
       
    71 	EBioMsgIdWap,
       
    72 
       
    73 	/** WAP secure WDP.
       
    74 	
       
    75 	Specifies that the WAP bearer should match messages against the ID port field. */
       
    76 	EBioMsgIdWapSecure,
       
    77 
       
    78 	/** WAP WSP.
       
    79 	
       
    80 	Specifies that the WAP bearer should match messages against the ID port field. */
       
    81 	EBioMsgIdWsp,
       
    82 
       
    83 	/** WAP secure WSP.
       
    84 	
       
    85 	Specifies that the WAP bearer should match messages against the ID port field. */
       
    86 	EBioMsgIdWspSecure
       
    87 	};
       
    88 
       
    89 /** Encapsulates an ID from a BIF (BIO_INFO_FILE).
       
    90  *
       
    91  * @publishedAll
       
    92  * @released
       
    93  */
       
    94 class TBioMsgId 
       
    95 	{
       
    96 public:
       
    97 	/** Identifies the bearer that should use this resource to match messages. */
       
    98 	TBioMsgIdType iType;
       
    99 	/** Confidence level. */
       
   100 	CApaDataRecognizerType::TRecognitionConfidence iConfidence;			// from APMREC.H
       
   101 	/** Text field that can be used to match the message to this BIO type. */
       
   102 	TBioMsgIdText iText;
       
   103 	/** Receiving port number that can be used to match the message to this BIO type. */
       
   104 	TUint16 iPort;
       
   105 	/** Expected receiving character set of messages. */
       
   106 	TUid iCharacterSet;
       
   107 	/** This is available for 3rd party use for BIO message type identity specific 
       
   108 	data. */
       
   109 	TInt16 iGeneralIdData;
       
   110 	};
       
   111 	
       
   112 // NOTE - this is included here cos the CBioInfoFile requires some of the enums 
       
   113 // defined above.
       
   114 #include "bifbase.h"			// for CBioInfoFile
       
   115 
       
   116 /** BIO information file (BIF) reader. 
       
   117 
       
   118 Allows reading (all but the icons) from an existing BIF file.
       
   119 
       
   120 @publishedAll
       
   121 @released
       
   122 */
       
   123 class CBioInfoFileReader : public CBioInfoFile
       
   124 	{
       
   125 public:
       
   126 	//
       
   127 	// Construction/destruction
       
   128 	IMPORT_C static CBioInfoFileReader* NewLC(RFs& aFs,const TDesC& aFileName,TUid aMsgTypeUid=KNullUid);
       
   129 	IMPORT_C static CBioInfoFileReader* NewL(RFs& aFs,const TDesC& aFileName,TUid aMsgTypeUid=KNullUid);
       
   130 	IMPORT_C virtual ~CBioInfoFileReader();
       
   131 
       
   132 	//
       
   133 	// Data getters
       
   134 	IMPORT_C TUid MessageTypeUid() const;
       
   135 	IMPORT_C const TPtrC MessageParserName() const;
       
   136 	IMPORT_C TUid MessageAppUid() const;
       
   137 	IMPORT_C TUid MessageAppCtrlUid() const;
       
   138 	IMPORT_C const TPtrC MessageAppCtrlName() const;
       
   139 	IMPORT_C TInt16 GeneralData1() const;
       
   140 	IMPORT_C TInt16 GeneralData2() const;
       
   141 	IMPORT_C TInt16 GeneralData3() const;
       
   142 	IMPORT_C const TPtrC Description() const;			
       
   143 	IMPORT_C const TPtrC FileExtension() const;			
       
   144 
       
   145 	IMPORT_C const TPtrC IconsFilename() const;			
       
   146 	IMPORT_C const CArrayFixFlat<TInt16>* ZoomLevelsLC() const;
       
   147 	IMPORT_C TInt ZoomLevelsCount() const;			
       
   148 
       
   149 	IMPORT_C const CArrayFixFlat<TBioMsgId>* IdsLC() const;
       
   150 	
       
   151 	IMPORT_C const CBifEntry& BifEntry() const;
       
   152 
       
   153 private:
       
   154 	CBioInfoFileReader(RFs& aFs);
       
   155 	void ConstructL(const TDesC& aFileName, TUid aMsgTypeUid);
       
   156 
       
   157 private:
       
   158 	void InternalizeL(RReadStream& aStream);
       
   159 	void LoadResourceL(TUid aMsgTypeUid);
       
   160 	void LoadDataL(TUid aMsgTypeUid);
       
   161 	TBool IsResFileL() const;
       
   162 	TBool IsDatFile(const TUidType& aUidType) const;
       
   163     //
       
   164     HBufC*		iFileName;
       
   165     CBifEntry*	iEntry;
       
   166 	};
       
   167 
       
   168 #endif // __BIF_H__