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