williamr@2: // Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies). williamr@2: // All rights reserved. williamr@2: // This component and the accompanying materials are made available williamr@2: // 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 williamr@2: // which accompanies this distribution, and is available williamr@2: // at the URL "http://www.symbianfoundation.org/legal/licencesv10.html". williamr@2: // williamr@2: // Initial Contributors: williamr@2: // Nokia Corporation - initial contribution. williamr@2: // williamr@2: // Contributors: williamr@2: // williamr@2: // Description: williamr@2: // williamr@2: williamr@2: #ifndef __BIF_H__ williamr@2: #define __BIF_H__ williamr@2: williamr@2: #include williamr@2: williamr@2: class CBifEntry; williamr@2: williamr@2: // williamr@2: // Constants williamr@2: /** 2nd UID of BIF file stores. */ williamr@2: const TUid KUidBioInfoFile={0x10005233}; // unicode Uid, used as 2nd Uid of file store williamr@2: /** Indicates that when opening the message no application should be launched. */ williamr@2: const TUid KUidBioUseNoApp={0x00000000}; williamr@2: /** Indicates that when opened the message is to be viewed by the default application. */ williamr@2: const TUid KUidBioUseDefaultApp={0x100052b2}; williamr@2: /** Maximum length of BIO_INFO_FILE description field. */ williamr@2: const TInt KMaxBioDescription=128; williamr@2: /** Maximum length of ID text field. */ williamr@2: const TInt KMaxBioIdText=128; williamr@2: /** Unused from v7.0. williamr@2: williamr@2: Previously, it specified the maximum length of a command line to BIFTOOL. */ williamr@2: const TInt KMaxBioCommandLine=256; williamr@2: /** Maximum length of BIO_INFO_FILE file_extension field. */ williamr@2: const TInt KMaxBioFileExtension=10; williamr@2: williamr@2: // williamr@2: // Data types williamr@2: /** Buffer to hold a BIF ID identifier text field. */ williamr@2: typedef TBuf TBioMsgIdText; williamr@2: /** Unused from v7.0. williamr@2: williamr@2: Previously, it held a command line to BIFTOOL. */ williamr@2: typedef TBuf TBioCommand; williamr@2: williamr@2: /** Identifies bearers for the BIF ID type field. williamr@2: williamr@2: It is the C++ equivalent of the resource enum ID_TYPE. */ williamr@2: enum TBioMsgIdType williamr@2: { williamr@2: /** Unknown. williamr@2: williamr@2: Item will not be used in matching. */ williamr@2: EBioMsgIdUnknown, williamr@2: williamr@2: /** MIME type. williamr@2: williamr@2: Specifies that a bearer that transports MIME messages (e.g. e-mail) should williamr@2: match the MIME type against the ID text field. */ williamr@2: EBioMsgIdIana, williamr@2: williamr@2: /** Narrow band (SMS). williamr@2: williamr@2: Specifies that the SMS bearer should match messages against the ID port field. */ williamr@2: EBioMsgIdNbs, williamr@2: williamr@2: /** WAP WDP. williamr@2: williamr@2: Specifies that the WAP bearer should match messages against the ID port field. */ williamr@2: EBioMsgIdWap, williamr@2: williamr@2: /** WAP secure WDP. williamr@2: williamr@2: Specifies that the WAP bearer should match messages against the ID port field. */ williamr@2: EBioMsgIdWapSecure, williamr@2: williamr@2: /** WAP WSP. williamr@2: williamr@2: Specifies that the WAP bearer should match messages against the ID port field. */ williamr@2: EBioMsgIdWsp, williamr@2: williamr@2: /** WAP secure WSP. williamr@2: williamr@2: Specifies that the WAP bearer should match messages against the ID port field. */ williamr@2: EBioMsgIdWspSecure williamr@2: }; williamr@2: williamr@2: /** Encapsulates an ID from a BIF (BIO_INFO_FILE). williamr@2: @internalTechnology williamr@2: @released williamr@2: */ williamr@2: class TBioMsgId williamr@2: { williamr@2: public: williamr@2: /** Identifies the bearer that should use this resource to match messages. */ williamr@2: TBioMsgIdType iType; williamr@2: /** Confidence level. */ williamr@2: CApaDataRecognizerType::TRecognitionConfidence iConfidence; // from APMREC.H williamr@2: /** Text field that can be used to match the message to this BIO type. */ williamr@2: TBioMsgIdText iText; williamr@2: /** Receiving port number that can be used to match the message to this BIO type. */ williamr@2: TUint16 iPort; williamr@2: /** Expected receiving character set of messages. */ williamr@2: TUid iCharacterSet; williamr@2: /** This is available for 3rd party use for BIO message type identity specific williamr@2: data. */ williamr@2: TInt16 iGeneralIdData; williamr@2: }; williamr@2: williamr@2: // NOTE - this is included here cos the CBioInfoFile requires some of the enums williamr@2: // defined above. williamr@2: #include "bifbase.h" // for CBioInfoFile williamr@2: williamr@2: /** BIO information file (BIF) reader. williamr@2: williamr@2: Allows reading (all but the icons) from an existing BIF file. williamr@2: williamr@2: @publishedAll williamr@2: @released williamr@2: */ williamr@2: class CBioInfoFileReader : public CBioInfoFile williamr@2: { williamr@2: public: williamr@2: // williamr@2: // Construction/destruction williamr@2: IMPORT_C static CBioInfoFileReader* NewLC(RFs& aFs,const TDesC& aFileName,TUid aMsgTypeUid=KNullUid); williamr@2: IMPORT_C static CBioInfoFileReader* NewL(RFs& aFs,const TDesC& aFileName,TUid aMsgTypeUid=KNullUid); williamr@2: IMPORT_C virtual ~CBioInfoFileReader(); williamr@2: williamr@2: // williamr@2: // Data getters williamr@2: IMPORT_C TUid MessageTypeUid() const; williamr@2: IMPORT_C const TPtrC MessageParserName() const; williamr@2: IMPORT_C TUid MessageAppUid() const; williamr@2: IMPORT_C TUid MessageAppCtrlUid() const; williamr@2: IMPORT_C const TPtrC MessageAppCtrlName() const; williamr@2: IMPORT_C TInt16 GeneralData1() const; williamr@2: IMPORT_C TInt16 GeneralData2() const; williamr@2: IMPORT_C TInt16 GeneralData3() const; williamr@2: IMPORT_C const TPtrC Description() const; williamr@2: IMPORT_C const TPtrC FileExtension() const; williamr@2: williamr@2: IMPORT_C const TPtrC IconsFilename() const; williamr@2: IMPORT_C const CArrayFixFlat* ZoomLevelsLC() const; williamr@2: IMPORT_C TInt ZoomLevelsCount() const; williamr@2: williamr@2: IMPORT_C const CArrayFixFlat* IdsLC() const; williamr@2: williamr@2: IMPORT_C const CBifEntry& BifEntry() const; williamr@2: williamr@2: private: williamr@2: CBioInfoFileReader(RFs& aFs); williamr@2: void ConstructL(const TDesC& aFileName, TUid aMsgTypeUid); williamr@2: williamr@2: private: williamr@2: void InternalizeL(RReadStream& aStream); williamr@2: void LoadResourceL(TUid aMsgTypeUid); williamr@2: void LoadDataL(TUid aMsgTypeUid); williamr@2: TBool IsResFileL() const; williamr@2: TBool IsDatFile(const TUidType& aUidType) const; williamr@2: // williamr@2: HBufC* iFileName; williamr@2: CBifEntry* iEntry; williamr@2: }; williamr@2: williamr@2: #endif // __BIF_H__