epoc32/include/miutpars.h
branchSymbian2
changeset 3 e1b950c65cb4
parent 2 2fe1408b6811
child 4 837f303aceeb
     1.1 --- a/epoc32/include/miutpars.h	Tue Mar 16 16:12:26 2010 +0000
     1.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.3 @@ -1,98 +0,0 @@
     1.4 -// Copyright (c) 1998-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 -#if !defined (__MIUTPARS_H__)
    1.20 -#define __MIUTPARS_H__
    1.21 -
    1.22 -#include <e32base.h>
    1.23 -
    1.24 -// comment out line below to switch ON Internet message checking
    1.25 -//#define __NO_EMAIL_ADDRESS_CHECKING__
    1.26 -
    1.27 -class TImMessageField
    1.28 -/** Parses email message header fields for valid Internet email addresses, 
    1.29 -comments and aliases.
    1.30 -
    1.31 -A comment is a string surrounded by parentheses, as defined in RFC822, 3.1.4. 
    1.32 -
    1.33 -An alias is defined as any substring which appears to the left of a legal email address:  
    1.34 -for example, the string "this is an alias" in "this is an alias <an.email@address.com>".  
    1.35 -
    1.36 -For email addresses, the string being parsed: 
    1.37 -1) must contain an @ character, surrounded by valid address characters; 
    1.38 -2) may not contain more than one address or @ character; 
    1.39 -3) may contain aliases and comments.
    1.40 -
    1.41 -Note the following about the implementation of this class:
    1.42 -
    1.43 -1. Functions that test subject lines, ValidSubjectLine(),  and alias names, ValidAliasName(), were 
    1.44 -initially written to test that the strings did not contain characters outside a limited 
    1.45 -ASCII range. Unicode characters are now allowed, so these functions now always return true.
    1.46 -
    1.47 -2. Of the four overloads of GetValidInternetEmailAddressFromString(), only the first has a meaningful
    1.48 -implementation. 
    1.49 -
    1.50 -@publishedAll
    1.51 -@released
    1.52 -*/
    1.53 -	{
    1.54 -public:
    1.55 -	IMPORT_C TBool ValidInternetEmailAddress(const TDesC16& aAddress);
    1.56 -	IMPORT_C TBool ValidInternetEmailAddress(const TDesC16& aAddress, TInt& rFirstBadCharPos);	
    1.57 -	IMPORT_C TBool ValidInternetEmailAddress(const TDesC16& aAddress, TInt& rFirstChar, TInt& rLastChar);
    1.58 -	IMPORT_C TBool ValidInternetEmailAddress(const TDesC16& aAddress, TInt& rFirstChar, TInt& rLastChar, TInt& rFirstBadCharPos);
    1.59 -
    1.60 -	IMPORT_C TBool ValidInternetEmailAddressChar(const TChar& aChar);	
    1.61 -
    1.62 -	IMPORT_C TBool ValidSubjectLine(const TDesC16& aSubjectLine);
    1.63 -	IMPORT_C TBool ValidSubjectLine(const TDesC16& aSubjectLine, TInt& rFirstBadCharPos);
    1.64 -	
    1.65 -	IMPORT_C TBool ValidSubjectLineChar(const TChar& aChar);
    1.66 -	
    1.67 -	IMPORT_C TBool ValidAliasName(const TDesC16& aAliasName);
    1.68 -	IMPORT_C TBool ValidAliasName(const TDesC16& aAliasName, TInt& rFirstBadCharPos);
    1.69 -
    1.70 -	IMPORT_C TPtrC16 GetValidInternetEmailAddressFromString(const TDesC16& aAddress);
    1.71 -	IMPORT_C TPtrC16 GetValidInternetEmailAddressFromString(const TDesC16& aAddress, TInt& rError);
    1.72 -	IMPORT_C TPtrC16 GetValidInternetEmailAddressFromString(const TDesC16& aAddress, TInt& rFirstChar, TInt& rLastChar);
    1.73 -	IMPORT_C TPtrC16 GetValidInternetEmailAddressFromString(const TDesC16& aAddress, TInt& rFirstChar, TInt& rLastChar, TInt& rError);
    1.74 -
    1.75 -	IMPORT_C TPtrC16 GetValidAlias(const TDesC16& aAddress);
    1.76 -	IMPORT_C TPtrC16 GetValidAlias(const TDesC16& aAddress, TInt& rError);
    1.77 -
    1.78 -	IMPORT_C TPtrC16 GetValidComment(const TDesC16& aAddress);
    1.79 -	IMPORT_C TPtrC16 GetValidComment(const TDesC16& aAddress, TInt& rError);
    1.80 -	TBool TruncateAddressString(const TDesC16& aDesc, TInt aLimit, TInt& aLastChar);
    1.81 -private:
    1.82 -	TBool isValidEmailAddress(const TDesC16& aAddress, TInt& rFirstChar, TInt& rLastChar);
    1.83 -	TBool isLegalEmailAddress(const TDesC16& aAddress, TInt& rFirstChar, TInt& rLastChar);
    1.84 -	TBool isSurroundedByRoundBrackets(const TDesC16& aAddress, TInt& rFirstChar, TInt& rLastChar);
    1.85 -	TBool isSurroundedByAngledBrackets(const TDesC16& aAddress, TInt& rFirstChar, TInt& rLastChar, TInt aAtPos);
    1.86 -	TBool isEnclosedSubString(const TDesC16& anAddress, const TChar& aLeftBracket, const TChar& aRightBracket,TInt& aLeftPos, TInt& aRightPos);
    1.87 -    TBool isValidString(const TDesC16& anAddress, TInt& aFirstBadCharPos);
    1.88 -	TBool isValidChar(const TChar& aChar);
    1.89 -    TBool isValidEmailString(const TDesC16& anAddress, TInt& aFirstBadCharPos);
    1.90 -	TBool isValidEmailChar(const TChar& aChar);
    1.91 -	TBool LocateSubString(const TDesC16& anAddress, const TInt atPos, TInt& rFirstChar, TInt& rLastChar);	
    1.92 -	TBool hasAngledBrackets(const TDesC16& anAddress);
    1.93 -	TBool isValid_ISO88591String(const TDesC16& aString,TInt& aPos);
    1.94 -	TBool isValidRoutedEmailAddress(const TDesC16& anAddress);
    1.95 -	TBool isValidDomainNameChar(const TChar& aChar);
    1.96 -	TBool isValidMailboxChar(const TChar& aChar);
    1.97 -	TBool isDotChar(const TChar& aChar);
    1.98 -	};
    1.99 -
   1.100 -
   1.101 -#endif // !defined __MIUTPARS_H__