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