epoc32/include/mw/bif.h
author William Roberts <williamr@symbian.org>
Wed, 31 Mar 2010 12:27:01 +0100
branchSymbian2
changeset 3 e1b950c65cb4
parent 2 epoc32/include/bif.h@2fe1408b6811
child 4 837f303aceeb
permissions -rw-r--r--
Attempt to represent the S^2->S^3 header reorganisation as a series of "hg rename" operations
williamr@2
     1
// Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
williamr@2
     2
// All rights reserved.
williamr@2
     3
// This component and the accompanying materials are made available
williamr@2
     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
williamr@2
     5
// which accompanies this distribution, and is available
williamr@2
     6
// at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
williamr@2
     7
//
williamr@2
     8
// Initial Contributors:
williamr@2
     9
// Nokia Corporation - initial contribution.
williamr@2
    10
//
williamr@2
    11
// Contributors:
williamr@2
    12
//
williamr@2
    13
// Description:
williamr@2
    14
//
williamr@2
    15
williamr@2
    16
#ifndef __BIF_H__
williamr@2
    17
#define __BIF_H__
williamr@2
    18
williamr@2
    19
#include <apmrec.h>
williamr@2
    20
williamr@2
    21
class CBifEntry;
williamr@2
    22
williamr@2
    23
//
williamr@2
    24
// Constants
williamr@2
    25
/** 2nd UID of BIF file stores. */
williamr@2
    26
const TUid KUidBioInfoFile={0x10005233};		// unicode Uid, used as 2nd Uid of file store
williamr@2
    27
/** Indicates that when opening the message no application should be launched. */
williamr@2
    28
const TUid KUidBioUseNoApp={0x00000000};			
williamr@2
    29
/** Indicates that when opened the message is to be viewed by the default application. */
williamr@2
    30
const TUid KUidBioUseDefaultApp={0x100052b2};		
williamr@2
    31
/** Maximum length of BIO_INFO_FILE description field. */
williamr@2
    32
const TInt KMaxBioDescription=128;
williamr@2
    33
/** Maximum length of ID text field. */
williamr@2
    34
const TInt KMaxBioIdText=128;
williamr@2
    35
/** Unused from v7.0.
williamr@2
    36
williamr@2
    37
Previously, it specified the maximum length of a command line to BIFTOOL. */
williamr@2
    38
const TInt KMaxBioCommandLine=256;
williamr@2
    39
/** Maximum length of BIO_INFO_FILE file_extension field. */
williamr@2
    40
const TInt KMaxBioFileExtension=10;
williamr@2
    41
williamr@2
    42
//
williamr@2
    43
// Data types
williamr@2
    44
/** Buffer to hold a BIF ID identifier text field. */
williamr@2
    45
typedef TBuf<KMaxBioIdText> TBioMsgIdText;
williamr@2
    46
/** Unused from v7.0.
williamr@2
    47
williamr@2
    48
Previously, it held a command line to BIFTOOL. */
williamr@2
    49
typedef TBuf<KMaxBioCommandLine> TBioCommand;
williamr@2
    50
williamr@2
    51
/** Identifies bearers for the BIF ID type field.
williamr@2
    52
williamr@2
    53
It is the C++ equivalent of the resource enum ID_TYPE. */
williamr@2
    54
enum TBioMsgIdType 
williamr@2
    55
	{
williamr@2
    56
	/** Unknown.
williamr@2
    57
	
williamr@2
    58
	Item will not be used in matching. */
williamr@2
    59
	EBioMsgIdUnknown,
williamr@2
    60
williamr@2
    61
	/** MIME type.
williamr@2
    62
	
williamr@2
    63
	Specifies that a bearer that transports MIME messages (e.g. e-mail) should 
williamr@2
    64
	match the MIME type against the ID text field. */
williamr@2
    65
	EBioMsgIdIana,
williamr@2
    66
williamr@2
    67
	/** Narrow band (SMS).
williamr@2
    68
	
williamr@2
    69
	Specifies that the SMS bearer should match messages against the ID port field. */
williamr@2
    70
	EBioMsgIdNbs,
williamr@2
    71
williamr@2
    72
	/** WAP WDP.
williamr@2
    73
	
williamr@2
    74
	Specifies that the WAP bearer should match messages against the ID port field. */
williamr@2
    75
	EBioMsgIdWap,
williamr@2
    76
williamr@2
    77
	/** WAP secure WDP.
williamr@2
    78
	
williamr@2
    79
	Specifies that the WAP bearer should match messages against the ID port field. */
williamr@2
    80
	EBioMsgIdWapSecure,
williamr@2
    81
williamr@2
    82
	/** WAP WSP.
williamr@2
    83
	
williamr@2
    84
	Specifies that the WAP bearer should match messages against the ID port field. */
williamr@2
    85
	EBioMsgIdWsp,
williamr@2
    86
williamr@2
    87
	/** WAP secure WSP.
williamr@2
    88
	
williamr@2
    89
	Specifies that the WAP bearer should match messages against the ID port field. */
williamr@2
    90
	EBioMsgIdWspSecure
williamr@2
    91
	};
williamr@2
    92
williamr@2
    93
/** Encapsulates an ID from a BIF (BIO_INFO_FILE). 
williamr@2
    94
@internalTechnology
williamr@2
    95
@released
williamr@2
    96
*/
williamr@2
    97
class TBioMsgId 
williamr@2
    98
	{
williamr@2
    99
public:
williamr@2
   100
	/** Identifies the bearer that should use this resource to match messages. */
williamr@2
   101
	TBioMsgIdType iType;
williamr@2
   102
	/** Confidence level. */
williamr@2
   103
	CApaDataRecognizerType::TRecognitionConfidence iConfidence;			// from APMREC.H
williamr@2
   104
	/** Text field that can be used to match the message to this BIO type. */
williamr@2
   105
	TBioMsgIdText iText;
williamr@2
   106
	/** Receiving port number that can be used to match the message to this BIO type. */
williamr@2
   107
	TUint16 iPort;
williamr@2
   108
	/** Expected receiving character set of messages. */
williamr@2
   109
	TUid iCharacterSet;
williamr@2
   110
	/** This is available for 3rd party use for BIO message type identity specific 
williamr@2
   111
	data. */
williamr@2
   112
	TInt16 iGeneralIdData;
williamr@2
   113
	};
williamr@2
   114
	
williamr@2
   115
// NOTE - this is included here cos the CBioInfoFile requires some of the enums 
williamr@2
   116
// defined above.
williamr@2
   117
#include "bifbase.h"			// for CBioInfoFile
williamr@2
   118
williamr@2
   119
/** BIO information file (BIF) reader. 
williamr@2
   120
williamr@2
   121
Allows reading (all but the icons) from an existing BIF file.
williamr@2
   122
williamr@2
   123
@publishedAll
williamr@2
   124
@released
williamr@2
   125
*/
williamr@2
   126
class CBioInfoFileReader : public CBioInfoFile
williamr@2
   127
	{
williamr@2
   128
public:
williamr@2
   129
	//
williamr@2
   130
	// Construction/destruction
williamr@2
   131
	IMPORT_C static CBioInfoFileReader* NewLC(RFs& aFs,const TDesC& aFileName,TUid aMsgTypeUid=KNullUid);
williamr@2
   132
	IMPORT_C static CBioInfoFileReader* NewL(RFs& aFs,const TDesC& aFileName,TUid aMsgTypeUid=KNullUid);
williamr@2
   133
	IMPORT_C virtual ~CBioInfoFileReader();
williamr@2
   134
williamr@2
   135
	//
williamr@2
   136
	// Data getters
williamr@2
   137
	IMPORT_C TUid MessageTypeUid() const;
williamr@2
   138
	IMPORT_C const TPtrC MessageParserName() const;
williamr@2
   139
	IMPORT_C TUid MessageAppUid() const;
williamr@2
   140
	IMPORT_C TUid MessageAppCtrlUid() const;
williamr@2
   141
	IMPORT_C const TPtrC MessageAppCtrlName() const;
williamr@2
   142
	IMPORT_C TInt16 GeneralData1() const;
williamr@2
   143
	IMPORT_C TInt16 GeneralData2() const;
williamr@2
   144
	IMPORT_C TInt16 GeneralData3() const;
williamr@2
   145
	IMPORT_C const TPtrC Description() const;			
williamr@2
   146
	IMPORT_C const TPtrC FileExtension() const;			
williamr@2
   147
williamr@2
   148
	IMPORT_C const TPtrC IconsFilename() const;			
williamr@2
   149
	IMPORT_C const CArrayFixFlat<TInt16>* ZoomLevelsLC() const;
williamr@2
   150
	IMPORT_C TInt ZoomLevelsCount() const;			
williamr@2
   151
williamr@2
   152
	IMPORT_C const CArrayFixFlat<TBioMsgId>* IdsLC() const;
williamr@2
   153
	
williamr@2
   154
	IMPORT_C const CBifEntry& BifEntry() const;
williamr@2
   155
williamr@2
   156
private:
williamr@2
   157
	CBioInfoFileReader(RFs& aFs);
williamr@2
   158
	void ConstructL(const TDesC& aFileName, TUid aMsgTypeUid);
williamr@2
   159
williamr@2
   160
private:
williamr@2
   161
	void InternalizeL(RReadStream& aStream);
williamr@2
   162
	void LoadResourceL(TUid aMsgTypeUid);
williamr@2
   163
	void LoadDataL(TUid aMsgTypeUid);
williamr@2
   164
	TBool IsResFileL() const;
williamr@2
   165
	TBool IsDatFile(const TUidType& aUidType) const;
williamr@2
   166
    //
williamr@2
   167
    HBufC*		iFileName;
williamr@2
   168
    CBifEntry*	iEntry;
williamr@2
   169
	};
williamr@2
   170
williamr@2
   171
#endif // __BIF_H__