os/textandloc/fontservices/textshaperplugin/test/HindiDemo/source/hindiDemoApp.h
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/textandloc/fontservices/textshaperplugin/test/HindiDemo/source/hindiDemoApp.h	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,117 @@
     1.4 +/*
     1.5 +* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
     1.6 +* All rights reserved.
     1.7 +* This component and the accompanying materials are made available
     1.8 +* under the terms of "Eclipse Public License v1.0"
     1.9 +* which accompanies this distribution, and is available
    1.10 +* at the URL "http://www.eclipse.org/legal/epl-v10.html".
    1.11 +*
    1.12 +* Initial Contributors:
    1.13 +* Nokia Corporation - initial contribution.
    1.14 +*
    1.15 +* Contributors:
    1.16 +*
    1.17 +* Description: 
    1.18 +* hindiDemo.h
    1.19 +* hindiDemo application
    1.20 +*
    1.21 +*/
    1.22 +
    1.23 +
    1.24 +#ifndef __HINDIDEMO_H
    1.25 +#define __HINDIDEMO_H
    1.26 +
    1.27 +#include <coecntrl.h>
    1.28 +#include <coeccntx.h>
    1.29 +
    1.30 +#include <eikappui.h>
    1.31 +#include <eikapp.h>
    1.32 +#include <eikdoc.h>
    1.33 +#include <e32std.h>
    1.34 +
    1.35 +const TUid KUidHindiDemoApp={ 0x10005102 };
    1.36 +
    1.37 +class CEikCommandButton;
    1.38 +class CEikLabel;
    1.39 +class CEikRichTextEditor;
    1.40 +
    1.41 +// class CHindiContainer
    1.42 +class CHindiContainer : public CCoeControl, public MCoeControlObserver
    1.43 +    {
    1.44 +public:
    1.45 +    void ConstructL(const TRect& aRect);
    1.46 +    ~CHindiContainer();
    1.47 +
    1.48 +	void ChangeSample( TInt aSample);
    1.49 +	TInt GetSample();
    1.50 + 	void SetHindiFont( TFontSpec& aFontSpec );
    1.51 +	void SetFontSize( TInt aFontSize );
    1.52 +	TInt GetFontSize();
    1.53 +	void CreateHindiTxtFile() const;
    1.54 +	void CreateKannadaTxtFile() const;
    1.55 +	void CreateBengaliTxtFile() const;
    1.56 +	void CreateTamilTxtFile() const;
    1.57 +	void CreateGujaratiTxtFile() const;
    1.58 +	void CreateTeluguTxtFile() const;
    1.59 +	
    1.60 +private:
    1.61 +	void SizeChanged();
    1.62 +	TInt CountComponentControls() const;
    1.63 +	CCoeControl* ComponentControl(TInt aIndex) const;
    1.64 +	void HandleControlEventL(CCoeControl* aControl,TCoeEvent aEventType);
    1.65 +	void Draw(const TRect& aRect) const;
    1.66 +
    1.67 +	void NextTestL();
    1.68 +
    1.69 +private:
    1.70 +	CEikLabel* iTest;
    1.71 +	CEikRichTextEditor* iOutputWindow;
    1.72 +
    1.73 +	void DrawHindiText(CWindowGc& aGc) const;
    1.74 + 	void DisableShaping(const TDesC* aInput, TDes& aOutput ) const;
    1.75 +   
    1.76 +    TInt iSample;
    1.77 +    TFontSpec iFontSpec;
    1.78 +	TInt iFontSize;
    1.79 +    };
    1.80 +
    1.81 +
    1.82 +// class CHindiEikDocument
    1.83 +
    1.84 +class CHindiEikDocument : public CEikDocument
    1.85 +	{
    1.86 +public:
    1.87 +	void ConstructL();
    1.88 +	CHindiEikDocument(CEikApplication& aApp): CEikDocument(aApp) { }
    1.89 +	~CHindiEikDocument() {}
    1.90 +	// Stop doc file being created
    1.91 +	CFileStore* OpenFileL(TBool /*aDoOpen*/,
    1.92 +	const TDesC& /*aFilename*/,RFs& /*aFs*/) {return NULL;}
    1.93 +private: 
    1.94 +	// from CEikDocument
    1.95 +	CEikAppUi* CreateAppUiL();
    1.96 +	};
    1.97 +
    1.98 +// CHindiAppUi
    1.99 +class CHindiAppUi : public CEikAppUi
   1.100 +    {
   1.101 +public:
   1.102 +    void ConstructL();
   1.103 +	~CHindiAppUi();
   1.104 +private: // from CEikAppUi
   1.105 +	void HandleCommandL(TInt aCommand);
   1.106 +	TKeyResponse HandleKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aType);
   1.107 +private:
   1.108 +    CHindiContainer * iAppView;
   1.109 +    };
   1.110 +
   1.111 +
   1.112 +// CHindiApplication
   1.113 +class CHindiApplication : public CEikApplication
   1.114 +	{
   1.115 +private: 
   1.116 +	// from CApaApplication
   1.117 +	CApaDocument* CreateDocumentL();
   1.118 +	TUid AppDllUid() const;
   1.119 +	};
   1.120 +#endif