epoc32/include/bif.h
branchSymbian2
changeset 2 2fe1408b6811
parent 0 061f57f2323e
     1.1 --- a/epoc32/include/bif.h	Tue Nov 24 13:55:44 2009 +0000
     1.2 +++ b/epoc32/include/bif.h	Tue Mar 16 16:12:26 2010 +0000
     1.3 @@ -1,1 +1,171 @@
     1.4 -bif.h
     1.5 +// Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
     1.6 +// All rights reserved.
     1.7 +// This component and the accompanying materials are made available
     1.8 +// 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.9 +// which accompanies this distribution, and is available
    1.10 +// at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
    1.11 +//
    1.12 +// Initial Contributors:
    1.13 +// Nokia Corporation - initial contribution.
    1.14 +//
    1.15 +// Contributors:
    1.16 +//
    1.17 +// Description:
    1.18 +//
    1.19 +
    1.20 +#ifndef __BIF_H__
    1.21 +#define __BIF_H__
    1.22 +
    1.23 +#include <apmrec.h>
    1.24 +
    1.25 +class CBifEntry;
    1.26 +
    1.27 +//
    1.28 +// Constants
    1.29 +/** 2nd UID of BIF file stores. */
    1.30 +const TUid KUidBioInfoFile={0x10005233};		// unicode Uid, used as 2nd Uid of file store
    1.31 +/** Indicates that when opening the message no application should be launched. */
    1.32 +const TUid KUidBioUseNoApp={0x00000000};			
    1.33 +/** Indicates that when opened the message is to be viewed by the default application. */
    1.34 +const TUid KUidBioUseDefaultApp={0x100052b2};		
    1.35 +/** Maximum length of BIO_INFO_FILE description field. */
    1.36 +const TInt KMaxBioDescription=128;
    1.37 +/** Maximum length of ID text field. */
    1.38 +const TInt KMaxBioIdText=128;
    1.39 +/** Unused from v7.0.
    1.40 +
    1.41 +Previously, it specified the maximum length of a command line to BIFTOOL. */
    1.42 +const TInt KMaxBioCommandLine=256;
    1.43 +/** Maximum length of BIO_INFO_FILE file_extension field. */
    1.44 +const TInt KMaxBioFileExtension=10;
    1.45 +
    1.46 +//
    1.47 +// Data types
    1.48 +/** Buffer to hold a BIF ID identifier text field. */
    1.49 +typedef TBuf<KMaxBioIdText> TBioMsgIdText;
    1.50 +/** Unused from v7.0.
    1.51 +
    1.52 +Previously, it held a command line to BIFTOOL. */
    1.53 +typedef TBuf<KMaxBioCommandLine> TBioCommand;
    1.54 +
    1.55 +/** Identifies bearers for the BIF ID type field.
    1.56 +
    1.57 +It is the C++ equivalent of the resource enum ID_TYPE. */
    1.58 +enum TBioMsgIdType 
    1.59 +	{
    1.60 +	/** Unknown.
    1.61 +	
    1.62 +	Item will not be used in matching. */
    1.63 +	EBioMsgIdUnknown,
    1.64 +
    1.65 +	/** MIME type.
    1.66 +	
    1.67 +	Specifies that a bearer that transports MIME messages (e.g. e-mail) should 
    1.68 +	match the MIME type against the ID text field. */
    1.69 +	EBioMsgIdIana,
    1.70 +
    1.71 +	/** Narrow band (SMS).
    1.72 +	
    1.73 +	Specifies that the SMS bearer should match messages against the ID port field. */
    1.74 +	EBioMsgIdNbs,
    1.75 +
    1.76 +	/** WAP WDP.
    1.77 +	
    1.78 +	Specifies that the WAP bearer should match messages against the ID port field. */
    1.79 +	EBioMsgIdWap,
    1.80 +
    1.81 +	/** WAP secure WDP.
    1.82 +	
    1.83 +	Specifies that the WAP bearer should match messages against the ID port field. */
    1.84 +	EBioMsgIdWapSecure,
    1.85 +
    1.86 +	/** WAP WSP.
    1.87 +	
    1.88 +	Specifies that the WAP bearer should match messages against the ID port field. */
    1.89 +	EBioMsgIdWsp,
    1.90 +
    1.91 +	/** WAP secure WSP.
    1.92 +	
    1.93 +	Specifies that the WAP bearer should match messages against the ID port field. */
    1.94 +	EBioMsgIdWspSecure
    1.95 +	};
    1.96 +
    1.97 +/** Encapsulates an ID from a BIF (BIO_INFO_FILE). 
    1.98 +@internalTechnology
    1.99 +@released
   1.100 +*/
   1.101 +class TBioMsgId 
   1.102 +	{
   1.103 +public:
   1.104 +	/** Identifies the bearer that should use this resource to match messages. */
   1.105 +	TBioMsgIdType iType;
   1.106 +	/** Confidence level. */
   1.107 +	CApaDataRecognizerType::TRecognitionConfidence iConfidence;			// from APMREC.H
   1.108 +	/** Text field that can be used to match the message to this BIO type. */
   1.109 +	TBioMsgIdText iText;
   1.110 +	/** Receiving port number that can be used to match the message to this BIO type. */
   1.111 +	TUint16 iPort;
   1.112 +	/** Expected receiving character set of messages. */
   1.113 +	TUid iCharacterSet;
   1.114 +	/** This is available for 3rd party use for BIO message type identity specific 
   1.115 +	data. */
   1.116 +	TInt16 iGeneralIdData;
   1.117 +	};
   1.118 +	
   1.119 +// NOTE - this is included here cos the CBioInfoFile requires some of the enums 
   1.120 +// defined above.
   1.121 +#include "bifbase.h"			// for CBioInfoFile
   1.122 +
   1.123 +/** BIO information file (BIF) reader. 
   1.124 +
   1.125 +Allows reading (all but the icons) from an existing BIF file.
   1.126 +
   1.127 +@publishedAll
   1.128 +@released
   1.129 +*/
   1.130 +class CBioInfoFileReader : public CBioInfoFile
   1.131 +	{
   1.132 +public:
   1.133 +	//
   1.134 +	// Construction/destruction
   1.135 +	IMPORT_C static CBioInfoFileReader* NewLC(RFs& aFs,const TDesC& aFileName,TUid aMsgTypeUid=KNullUid);
   1.136 +	IMPORT_C static CBioInfoFileReader* NewL(RFs& aFs,const TDesC& aFileName,TUid aMsgTypeUid=KNullUid);
   1.137 +	IMPORT_C virtual ~CBioInfoFileReader();
   1.138 +
   1.139 +	//
   1.140 +	// Data getters
   1.141 +	IMPORT_C TUid MessageTypeUid() const;
   1.142 +	IMPORT_C const TPtrC MessageParserName() const;
   1.143 +	IMPORT_C TUid MessageAppUid() const;
   1.144 +	IMPORT_C TUid MessageAppCtrlUid() const;
   1.145 +	IMPORT_C const TPtrC MessageAppCtrlName() const;
   1.146 +	IMPORT_C TInt16 GeneralData1() const;
   1.147 +	IMPORT_C TInt16 GeneralData2() const;
   1.148 +	IMPORT_C TInt16 GeneralData3() const;
   1.149 +	IMPORT_C const TPtrC Description() const;			
   1.150 +	IMPORT_C const TPtrC FileExtension() const;			
   1.151 +
   1.152 +	IMPORT_C const TPtrC IconsFilename() const;			
   1.153 +	IMPORT_C const CArrayFixFlat<TInt16>* ZoomLevelsLC() const;
   1.154 +	IMPORT_C TInt ZoomLevelsCount() const;			
   1.155 +
   1.156 +	IMPORT_C const CArrayFixFlat<TBioMsgId>* IdsLC() const;
   1.157 +	
   1.158 +	IMPORT_C const CBifEntry& BifEntry() const;
   1.159 +
   1.160 +private:
   1.161 +	CBioInfoFileReader(RFs& aFs);
   1.162 +	void ConstructL(const TDesC& aFileName, TUid aMsgTypeUid);
   1.163 +
   1.164 +private:
   1.165 +	void InternalizeL(RReadStream& aStream);
   1.166 +	void LoadResourceL(TUid aMsgTypeUid);
   1.167 +	void LoadDataL(TUid aMsgTypeUid);
   1.168 +	TBool IsResFileL() const;
   1.169 +	TBool IsDatFile(const TUidType& aUidType) const;
   1.170 +    //
   1.171 +    HBufC*		iFileName;
   1.172 +    CBifEntry*	iEntry;
   1.173 +	};
   1.174 +
   1.175 +#endif // __BIF_H__