textrendering/texthandling/ttext/T_parse.h
changeset 32 8b9155204a54
parent 0 1fb32624e06b
equal deleted inserted replaced
31:b9ad20498fb4 32:8b9155204a54
       
     1 /*
       
     2 * Copyright (c) 1999-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description: 
       
    15 * An example parser
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 #ifndef __EXPARSER_H__
       
    21 #define __EXPARSER_H__
       
    22 
       
    23 #include <mparser.h>
       
    24 #include <medobsrv.h>
       
    25 
       
    26 
       
    27 class CTestParser : public CBase, public MParser
       
    28 	{
       
    29 public:
       
    30 	static CTestParser* NewL();
       
    31 
       
    32 	~CTestParser();
       
    33 
       
    34 	// Overloads for MParser interface
       
    35 	TBool ParseThisText(const CRichText& aTextObj, TBool aAllowBack,
       
    36 						TInt aStartScan, TInt aScanLength,
       
    37 						TInt& aStartTag, TInt& aTagLength);
       
    38 
       
    39 	const TDesC& CreateDoItText(const CRichText& aTextObj,
       
    40 								TInt aStartText, TInt aLength);
       
    41 
       
    42 	void ActivateThisTextL(const CRichText& aTextObj,
       
    43 						   TInt aStartText, TInt aLength);
       
    44 
       
    45 	TBool ReformatOnRecognise() const {return ETrue;}
       
    46 
       
    47 	TBool ReformatOnRollover() const {return ETrue;}
       
    48 
       
    49 	void GetRecogniseFormat(TCharFormat& aFormat);
       
    50 
       
    51 	void GetRolloverFormat(TCharFormat& aFormat);
       
    52 
       
    53 	void Release();
       
    54 
       
    55 private:
       
    56 	CTestParser();
       
    57 
       
    58 private:
       
    59 	HBufC* iDoItText;
       
    60 	};
       
    61 
       
    62 //-----------------------------------------------
       
    63 
       
    64 class CTestParser2 : public CBase, public MParser
       
    65 	{
       
    66 public:
       
    67 	static CTestParser2* NewL();
       
    68 
       
    69 	~CTestParser2();
       
    70 
       
    71 	// Overloads for MParser interface
       
    72 	TBool ParseThisText(const CRichText& aTextObj, TBool aAllowBack,
       
    73 						TInt aStartScan, TInt aScanLength,
       
    74 						TInt& aStartTag, TInt& aTagLength);
       
    75 
       
    76 	const TDesC& CreateDoItText(const CRichText& aTextObj,
       
    77 								TInt aStartText, TInt aLength);
       
    78 
       
    79 	void ActivateThisTextL(const CRichText& aTextObj,
       
    80 						   TInt aStartText, TInt aLength);
       
    81 
       
    82 	TBool ReformatOnRecognise() const {return ETrue;}
       
    83 
       
    84 	TBool ReformatOnRollover() const {return ETrue;}
       
    85 
       
    86 	void GetRecogniseFormat(TCharFormat& aFormat);
       
    87 
       
    88 	void GetRolloverFormat(TCharFormat& aFormat);
       
    89 
       
    90 	void Release();
       
    91 
       
    92 private:
       
    93 	CTestParser2();
       
    94 
       
    95 private:
       
    96 	HBufC* iDoItText;
       
    97 	};
       
    98 
       
    99 
       
   100 class CEditObserver : public CBase, public MEditObserver
       
   101 	{
       
   102 public:
       
   103 	CEditObserver();
       
   104 	~CEditObserver();
       
   105 	void EditObserver(TInt aStart, TInt aExtent);
       
   106 
       
   107 public:
       
   108 	TInt iStart;
       
   109 	TInt iExtent;
       
   110 	};
       
   111 
       
   112 #endif