1 // Copyright (c) 1999-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 "Eclipse Public License v1.0"
5 // which accompanies this distribution, and is available
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
18 * BIO information file (BIF) database.
27 #include <bif.h> // the bif reader
30 #ifndef SYMBIAN_ENABLE_SPLIT_HEADERS
31 #include <bifchangeobserver.h>
36 /** BIO information file (BIF) database.
38 This class reads the installed BIF files and allows information from them
39 to be easily extracted.
45 class CBIODatabase : public CBase
48 /** Search methods. */
51 /** Begin search from the start. */
53 /** Begin search from the last index position. */
57 IMPORT_C static CBIODatabase* NewLC(RFs& afileSystem);
58 IMPORT_C static CBIODatabase* NewL(RFs& afileSystem);
59 IMPORT_C ~CBIODatabase();
62 // BIF files contain all the information that needs to be registered
63 // for each BIO Message type
65 // Completely refresh the database will all the BIF Files in the
67 IMPORT_C void AddAllBifsL(RFs& afileSystem);
69 // Add one bifFile using the file name, then using Neil's handy
71 // This will add the Parser
72 IMPORT_C void AddBifL(CBioInfoFileReader* aBifReader);
73 IMPORT_C void RemoveBifL(TUid aMsgID);
74 IMPORT_C void RemoveBifL(TInt aIndex);
76 // BIO Messages are determined to of a BIO type if we have the BIO
77 // Parser identified by a WAP/NBS port, IANA MIME type or a Pattern
78 IMPORT_C TInt BIOCount();
80 // Get the BioEntry at this index
81 // Return Index if found, NULL if not
82 IMPORT_C const CArrayFix<TBioMsgId>* BIOEntryLC(TInt index);
85 // Get the whole bif file class
86 IMPORT_C const CBioInfoFileReader& BifReader(TInt aIndex) const;
88 // Get the BIO Entry based on what type it is, pos indicates where to start looking
89 // after, and will get updated to current pos
90 IMPORT_C const CArrayFix<TBioMsgId>* BioEntryByTypeLC(
91 TSearchList aSearchType,
92 TBioMsgIdType portType,
95 IMPORT_C void GetBioIndexWithMsgIDL(TUid aMsgID, TInt& rIndex);
97 // Get the BioMessageID for the Index
98 IMPORT_C void GetBioMsgID(TInt aIndex, TUid& rMsgID);
100 // Get the BioParserName for the Index
101 IMPORT_C const TPtrC GetBioParserName(TInt aIndex);
103 // Get the BioParserName for the BioMessageID
104 IMPORT_C const TPtrC GetBioParserNameL(TUid aMsgID);
106 // Get the ControlID for the Index
107 IMPORT_C void GetBioControlID(TInt aIndex, TUid& rControlID);
109 // Get the ControlID for the BioMessageID
110 IMPORT_C void GetBioControlIDL(TUid aMsgID, TUid& rControlID);
112 IMPORT_C const TPtrC GetBioControlName(TInt aIndex);
113 IMPORT_C const TPtrC GetBioControlNameL(TUid aMsgID);
115 // Get the String Extension for the BioMessageID
116 IMPORT_C const TPtrC GetFileExtL(TUid aMsgID);
118 IMPORT_C void GetDefaultSendBearerL(TUid aBioUID, TBioMsgId& rBioMsgIdentifier);
119 IMPORT_C void GetDefaultSendBearerTypeL(TUid aBioUID, TBioMsgIdType& rPortType);
120 IMPORT_C void GetDefaultSendBearerByTypeL(TUid aBioUID, TBioMsgIdType aPortType, TBioMsgId& rBioMsgIdentifier);
122 // BIO Messages are determined to of a BIO type if we have the BIO
123 // Parser identified by a WAP/NBS port, IANA MIME type or a Pattern
126 // Get the Port# or Identifying string for sending
127 IMPORT_C void GetPortNumberL(TUid aMsgID, TBioMsgIdType aPortType, TInt& aPortNumber);
128 IMPORT_C void GetIdentifierTextL(TUid aMsgID, TBioMsgIdType aPortType, TBioMsgIdText& aText);
130 // Test to see if this is a BioMessage
131 // Pass in the type ... if its NBS or IANA pass in the string pattern
132 // if its WAP or SecureWap, pass in the port number
133 // return kErrNone if success, kErrNotFound if it fails
134 IMPORT_C TInt IsBioMessageL(TBioMsgIdType aPortType, const TDesC& aPattern, TUint16 aPort, TUid& rBioMsgUID);
136 IMPORT_C TInt IsBioMessageL(TBioMsgId bioMessageData, TUid& rBioMsgUID);
140 void ConstructL(RFs& afileSystem);
144 void GetTransportIDL(TInt aIndex, TBioMsgIdType aPortType, TBioMsgId& aBioMsgID);
145 TBool IsLanguageFileL(const TDesC& aFileName, TInt& aExtLength) const;
146 // If Persistence is required...
147 // void InternalizeL(RReadStream& aStream);
148 // void ExternalizeL(RWriteStream& aStream) const;
151 CArrayPtrFlat<CBioInfoFileReader>* iBifReaders;
155 #endif // __BIODB_H__