epoc32/include/mw/bsp.h
branchSymbian3
changeset 4 837f303aceeb
parent 3 e1b950c65cb4
equal deleted inserted replaced
3:e1b950c65cb4 4:837f303aceeb
     1 // Copyright (c) 1998-2009 Nokia Corporation and/or its subsidiary(-ies).
     1 // Copyright (c) 1998-2009 Nokia Corporation and/or its subsidiary(-ies).
     2 // All rights reserved.
     2 // All rights reserved.
     3 // This component and the accompanying materials are made available
     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
     4 // under the terms of "Eclipse Public License v1.0"
     5 // which accompanies this distribution, and is available
     5 // which accompanies this distribution, and is available
     6 // at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
     7 //
     7 //
     8 // Initial Contributors:
     8 // Initial Contributors:
     9 // Nokia Corporation - initial contribution.
     9 // Nokia Corporation - initial contribution.
    10 //
    10 //
    11 // Contributors:
    11 // Contributors:
    12 //
    12 //
    13 // Description:
    13 // Description:
    14 // BSP.H (Base Script Parser)
    14 // BSP.H (Base Script Parser)
    15 // Abstract class for different Parsers.
       
    16 // 
    15 // 
    17 //
    16 //
    18 
    17 
    19 
    18 /**
       
    19  * @file 
       
    20  * Abstract class for different Parsers.
       
    21  *
       
    22  * @publishedAll
       
    23  * @released
       
    24  */
    20 #if !defined(__BSP_H__)
    25 #if !defined(__BSP_H__)
    21 #define __BSP_H__
    26 #define __BSP_H__
    22 
    27 
    23 #if !defined(__MTCLREG_H__)
    28 #if !defined(__MTCLREG_H__)
    24 #include <mtclreg.h>
    29 #include <mtclreg.h>
    38 #include <txtrich.h>
    43 #include <txtrich.h>
    39 #include <txtfmlyr.h>
    44 #include <txtfmlyr.h>
    40 
    45 
    41 #include <bif.h>
    46 #include <bif.h>
    42 
    47 
    43 
    48 #ifndef SYMBIAN_ENABLE_SPLIT_HEADERS 
    44 
    49 #include "tmsvbioinfo.h"
    45 // Symbols:
    50 #endif
    46 /** Space character. */
       
    47 #define KCharSpace          ' '
       
    48 /** Tab character. */
       
    49 #define KCharTab            '\t'
       
    50 /** Line feed character. */
       
    51 #define KCharLineFeed       '\n'
       
    52 
       
    53 
       
    54 // Define some generic error codes:
       
    55 /** BIO error code base. */
       
    56 const TInt KBspBaseError					= (-500);
       
    57 
       
    58 /** Invalid BIO message error code. */
       
    59 const TInt KBspInvalidMessage				= (KBspBaseError);
       
    60 /** Invalid smart message token error code. */
       
    61 const TInt KBspSmartMessageInvalidToken		= (KBspBaseError-1);
       
    62 /** No smart message parser defined error code. */
       
    63 const TInt KBspSmartMessageNoParserDefined	= (KBspBaseError-2);
       
    64 
    51 
    65 // Parsed field class for use by parsers.
    52 // Parsed field class for use by parsers.
    66 class CParsedField : public CBase
    53 class CParsedField : public CBase
    67 /** Represents a single token-value pair for a given field in a BIO/smart message 
    54 /** Represents a single token-value pair for a given field in a BIO/smart message 
    68 grammar. 
    55 grammar. 
    89 	HBufC* iFieldName;
    76 	HBufC* iFieldName;
    90 	HBufC* iFieldValue;
    77 	HBufC* iFieldValue;
    91 	TBool  iMandatoryField;
    78 	TBool  iMandatoryField;
    92 };
    79 };
    93 
    80 
    94 // Forward declarations:
    81 /**
       
    82  * Forward declarations:
       
    83  * @publishedAll
       
    84  * @released
       
    85  */
    95 class CMsvServerEntry;
    86 class CMsvServerEntry;
    96 class CMsvEntry;
    87 class CMsvEntry;
    97 class CRegisteredParserDll;
    88 class CRegisteredParserDll;
    98 class RMsvReadStream;
    89 class RMsvReadStream;
    99 class RMsvWriteStream;
    90 class RMsvWriteStream;
   100 class CMsvStore;
    91 class CMsvStore;
   101 class CSmsMessage;
    92 class CSmsMessage;
   102 
       
   103 
       
   104 
    93 
   105 /** Base class for BIO message parsers V2.
    94 /** Base class for BIO message parsers V2.
   106 
    95 
   107 Concrete derived classes are implemented in parser DLL's to parse particular 
    96 Concrete derived classes are implemented in parser DLL's to parse particular 
   108 types of BIO message.
    97 types of BIO message.
   210     HBufC*						iSmsBuf;                // Local copy of buffer passed to ParseL()
   199     HBufC*						iSmsBuf;                // Local copy of buffer passed to ParseL()
   211 	/** Temporary pointer used by RestoreL(). */
   200 	/** Temporary pointer used by RestoreL(). */
   212 	HBufC8*						iReadBuffer;			// used to restore data from file
   201 	HBufC8*						iReadBuffer;			// used to restore data from file
   213 	};
   202 	};
   214 
   203 
   215  
   204 #endif
   216 /** BIO data location flag values.
   205 
   217 
       
   218 @see TMsvBIOEntry */
       
   219 enum TMsvBIODataLocation
       
   220 	{
       
   221 	/** Unknown. */
       
   222 	EUnknown,
       
   223 	/** Parser wrote data into the body text. */
       
   224 	EBodyText,		// parser wrote data back into richText
       
   225 	/** Parser wrote data into the parsed fields data stream. */
       
   226 	EBIODataStream,	// parser wrote data into KUIDMsvBioStream
       
   227 	/** Parser wrote data into an attachment file. */
       
   228 	EFile			// parser wrote data into attachment file
       
   229 	};
       
   230 
       
   231 
       
   232 /** Bearer Independent Object entry.
       
   233 Specialises the TMsvEntry message entry class to store additional BIO message-specific 
       
   234 information. 
       
   235 @internalTechnology
       
   236 @released
       
   237 */
       
   238 class TMsvBIOEntry : public TMsvEntry
       
   239 	{
       
   240 public:
       
   241 	/** Constructor. */
       
   242 	TMsvBIOEntry() : TMsvEntry() {};
       
   243 	void SetBIOParserUid(const TUid aId);
       
   244 	const TUid BIOParserUid() const;
       
   245 	void SetLocationOfData(const TMsvBIODataLocation aLocation);
       
   246 	const TMsvBIODataLocation LocationOfData() const;
       
   247 
       
   248 private:
       
   249 	TMsvBIODataLocation	iLocationOfData;
       
   250 	};
       
   251 
       
   252 #include <bsp.inl>
       
   253 
       
   254 #endif