os/textandloc/fontservices/textshaperplugin/test/HindiDemo/source/hindiDemoApp.h
author sl@SLION-WIN7.fritz.box
Fri, 15 Jun 2012 03:10:57 +0200
changeset 0 bde4ae8d615e
permissions -rw-r--r--
First public contribution.
     1 /*
     2 * Copyright (c) 2007-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 * hindiDemo.h
    16 * hindiDemo application
    17 *
    18 */
    19 
    20 
    21 #ifndef __HINDIDEMO_H
    22 #define __HINDIDEMO_H
    23 
    24 #include <coecntrl.h>
    25 #include <coeccntx.h>
    26 
    27 #include <eikappui.h>
    28 #include <eikapp.h>
    29 #include <eikdoc.h>
    30 #include <e32std.h>
    31 
    32 const TUid KUidHindiDemoApp={ 0x10005102 };
    33 
    34 class CEikCommandButton;
    35 class CEikLabel;
    36 class CEikRichTextEditor;
    37 
    38 // class CHindiContainer
    39 class CHindiContainer : public CCoeControl, public MCoeControlObserver
    40     {
    41 public:
    42     void ConstructL(const TRect& aRect);
    43     ~CHindiContainer();
    44 
    45 	void ChangeSample( TInt aSample);
    46 	TInt GetSample();
    47  	void SetHindiFont( TFontSpec& aFontSpec );
    48 	void SetFontSize( TInt aFontSize );
    49 	TInt GetFontSize();
    50 	void CreateHindiTxtFile() const;
    51 	void CreateKannadaTxtFile() const;
    52 	void CreateBengaliTxtFile() const;
    53 	void CreateTamilTxtFile() const;
    54 	void CreateGujaratiTxtFile() const;
    55 	void CreateTeluguTxtFile() const;
    56 	
    57 private:
    58 	void SizeChanged();
    59 	TInt CountComponentControls() const;
    60 	CCoeControl* ComponentControl(TInt aIndex) const;
    61 	void HandleControlEventL(CCoeControl* aControl,TCoeEvent aEventType);
    62 	void Draw(const TRect& aRect) const;
    63 
    64 	void NextTestL();
    65 
    66 private:
    67 	CEikLabel* iTest;
    68 	CEikRichTextEditor* iOutputWindow;
    69 
    70 	void DrawHindiText(CWindowGc& aGc) const;
    71  	void DisableShaping(const TDesC* aInput, TDes& aOutput ) const;
    72    
    73     TInt iSample;
    74     TFontSpec iFontSpec;
    75 	TInt iFontSize;
    76     };
    77 
    78 
    79 // class CHindiEikDocument
    80 
    81 class CHindiEikDocument : public CEikDocument
    82 	{
    83 public:
    84 	void ConstructL();
    85 	CHindiEikDocument(CEikApplication& aApp): CEikDocument(aApp) { }
    86 	~CHindiEikDocument() {}
    87 	// Stop doc file being created
    88 	CFileStore* OpenFileL(TBool /*aDoOpen*/,
    89 	const TDesC& /*aFilename*/,RFs& /*aFs*/) {return NULL;}
    90 private: 
    91 	// from CEikDocument
    92 	CEikAppUi* CreateAppUiL();
    93 	};
    94 
    95 // CHindiAppUi
    96 class CHindiAppUi : public CEikAppUi
    97     {
    98 public:
    99     void ConstructL();
   100 	~CHindiAppUi();
   101 private: // from CEikAppUi
   102 	void HandleCommandL(TInt aCommand);
   103 	TKeyResponse HandleKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aType);
   104 private:
   105     CHindiContainer * iAppView;
   106     };
   107 
   108 
   109 // CHindiApplication
   110 class CHindiApplication : public CEikApplication
   111 	{
   112 private: 
   113 	// from CApaApplication
   114 	CApaDocument* CreateDocumentL();
   115 	TUid AppDllUid() const;
   116 	};
   117 #endif