os/textandloc/textrendering/word/SRC/WPTEST.H
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
     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 * Header for the CWordTest class; testing functions added to WORD after it ceased to be a standard EPOC application.
    16 *
    17 */
    18 
    19 
    20 
    21 
    22 #ifndef __WPTEST_H__
    23 #define __WPTEST_H__ 1
    24 
    25 #include <e32std.h>
    26 #include <txtfrmat.h> 
    27 
    28 class CWordTest: public CBase, public MFormCustomDraw
    29 /**
    30 @internalComponent
    31 */
    32 	{
    33 public:
    34 	static CWordTest* NewL(CTextView* aTextView);
    35 	~CWordTest();
    36 	TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aEventCode,TChar& aCharToBeInserted);
    37 	void Highlight(MUnifiedEditor& aEditor,TFontPresentation::TFontHighlightStyle aStyle);
    38 	void SetPictureAlignmentL(CEikRichTextEditor* aEditor,TFontPresentation::TAlignment aAlignment);
    39 	void SetWrapL(CEikRichTextEditor* aEditor,TBool aWrap);
    40 
    41 	enum TKeyboardCode
    42 		{
    43 		EStandardKeyboard,
    44 		EArabicKeyboard,
    45 		EGreekKeyboard,
    46 		ERussianKeyboard
    47 		};
    48 
    49 	TKeyboardCode Keyboard() const { return iKeyboard; }
    50 	void SetKeyboardL(TKeyboardCode aKeyboard);
    51 	void TurnOnCustomDrawing(CTextLayout* aLayout);
    52 	TBool RuledPaper() const { return iRuledPaper; }
    53 	void SetRuledPaperL(CEikRichTextEditor* aEditor,TBool aOn);
    54 	TBool BackgroundBitmap() const { return iBackgroundBitmap != NULL; }
    55 	void SetBackgroundBitmapL(CEikRichTextEditor* aEditor,TBool aOn);
    56 	void ToggleCaseL(CEikRichTextEditor* aEditor);
    57 	void BenchmarkL();
    58 	void SetTruncateWithEllipsisL(CEikRichTextEditor* aEditor,TBool aOn);
    59 	TBool TruncateWithEllipsis() const { return iTruncateWithEllipsis; }
    60 	TBool CursorFlashing() const { return iCursorFlashing; }
    61 	TTmCursorPlacement CursorPlacement() const { return iCursorPlacement; }
    62 	TInt CursorWeight() const { return iCursorWeight; }
    63 	TRgb CursorXorColor() const { return iCursorXorColor; }
    64 	void ToggleCursorFlash();
    65 	void SetCursorPlacement(TTmCursorPlacement aPlacement);
    66 	void SetCursorWeight(TInt aWeight);
    67 	void SetCursorXorColor(TRgb aColor);
    68 	void SetSelectionHighlightStyle(TInt aStyleIndex);
    69 	TInt SelectionHighlightStyle() const;
    70 	void SetCursorPositioningHintL(TCursorPosition::TPosHint aHint);
    71 	TCursorPosition::TPosHint CursorPositioningHint() const;
    72 	void InsertPictureL(CEikRichTextEditor* aEditor);
    73 private:
    74 	CWordTest(CTextView* aTextView);
    75 
    76 	// virtual functions from MFormCustomDraw
    77 	void DrawLineGraphics(const TParam& aParam,const TLineInfo& aLineInfo) const;
    78 	void DrawText(const TParam& aParam,const TLineInfo& aLineInfo,const TCharFormat& aFormat,const TDesC& aText,
    79 				  const TPoint& aTextOrigin,TInt aExtraPixels) const;
    80 	void DrawBackground(const TParam& aParam,const TRgb& aBackground,TRect& aDrawn) const;
    81 	TRgb SystemColor(TUint aColorIndex, TRgb aDefaultColor) const;
    82 
    83 	CTextView* iTextView;
    84 	TKeyboardCode iKeyboard;
    85 	TInt iKeyboardState;
    86 	TBool iRuledPaper;
    87 	CFbsBitmap* iBackgroundBitmap;
    88 	TBool iTruncateWithEllipsis;
    89 	TBool iCursorFlashing;
    90 	TTmCursorPlacement iCursorPlacement;
    91 	TInt iCursorWeight;
    92 	TRgb iCursorXorColor;
    93 	TInt iStyleIndex;
    94 	TCursorPosition::TPosHint iPositioningHint;
    95 	};
    96 
    97 #endif // __WPTEST_H__