os/textandloc/fontservices/textshaperplugin/test/S60HindiDemo/inc/MainViewcontainer.h
First public contribution.
2 * Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
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".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
15 * Series 60 version of Hindi Demo application
21 #ifndef __MAINVIEW_CONTAINER_H__
22 #define __MAINVIEW_CONTAINER_H__
24 #include "HindiDemo.hrh"
29 #include <akncontext.h>
31 #include <aknnavide.h>
37 const TInt KLengthOfNaviTempString = 100;
39 // -----------------------------------------------------------------------
41 // -----------------------------------------------------------------------
42 class CMainViewContainer : public CCoeControl, public MCoeControlObserver {
45 // -----------------------------------------------------------------------
46 // Creates a CMainViewContainer object
47 // -----------------------------------------------------------------------
48 static CMainViewContainer * NewL(const TRect& aRect);
50 // -----------------------------------------------------------------------
51 // Creates a CMainViewView object
52 // -----------------------------------------------------------------------
53 static CMainViewContainer * NewLC(const TRect& aRect);
55 // -----------------------------------------------------------------------
56 // Returns the number of controls contained in this compound control
57 // -----------------------------------------------------------------------
58 TInt CountComponentControls() const;
60 // -----------------------------------------------------------------------
61 // Returns the component at the specified index
62 // @param aIndex specifies index of component
63 // @return Pointer to component control
64 // -----------------------------------------------------------------------
65 CCoeControl * ComponentControl(TInt aIndex) const;
67 // -----------------------------------------------------------------------
68 // Draws this container
69 // -----------------------------------------------------------------------
70 void Draw(const TRect& aRect) const;
71 void DrawHindiText(CWindowGc& aGc) const;
72 void DisableShaping(const TDesC* aInput, TDes& aOutput ) const;
73 void SetHindiFont( TFontSpec& aFontSpec );
74 void ChangeSample( TInt aSample);
76 void SetFontSize( TInt aFontSize );
78 void SetUnderLine( enum TFontUnderline aUnderLine );
79 enum TFontUnderline GetUnderLine( );
81 void ChangePreviousFont();
82 void DisplayAvailableFonts();
84 // -----------------------------------------------------------------------
86 // -----------------------------------------------------------------------
87 ~CMainViewContainer();
90 // Handler for events sent by a control to this Observer
92 void HandleControlEventL(CCoeControl * aControl, TCoeEvent aEventType);
94 // --------------------------------------------------------------------------------------
95 // Overridden function used to pass key events to child controls owned by this container
96 // --------------------------------------------------------------------------------------
97 TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aType);
99 // -----------------------------------------------------------------------
100 // Routine that dispatches Command events to individual handlers
101 // -----------------------------------------------------------------------
102 bool DispatchViewCommandEvents(TInt aCommand);
105 // -----------------------------------------------------------------------
107 // -----------------------------------------------------------------------
108 CMainViewContainer();
110 // -----------------------------------------------------------------------
111 // Performs second phase construction of this Container
112 // -----------------------------------------------------------------------
113 void ConstructL(const TRect & aRect);
115 // -----------------------------------------------------------------------
116 // Routine that initializes components owned by this Container
117 // -----------------------------------------------------------------------
118 void InitComponentsL();
120 // -----------------------------------------------------------------------
121 // Routine that cleans up components owned by this container
122 // -----------------------------------------------------------------------
123 void CleanupComponents();
125 // -----------------------------------------------------------------------
126 // Routine that attempts to dispatch Control Events
127 // -----------------------------------------------------------------------
128 void DispatchControlEvents(CCoeControl * aControl, TCoeEvent aEventType);
130 // -----------------------------------------------------------------------
131 // Place holder routine to handle key events
132 // -----------------------------------------------------------------------
133 bool HandleKeyEvents(const TKeyEvent& aKeyEvent, TEventCode aType);
135 // -----------------------------------------------------------------------
136 // Helper method to manage control in focus
137 // -----------------------------------------------------------------------
138 void ChangeFocus(CCoeControl * aNewControl);
141 TRgb iBackgroundColor;
142 RPointerArray<CCoeControl> iCtrlArray;
143 CCoeControl* iFocusedControl;
146 // -----------------------------------------------------------------------------
147 CAknContextPane * iContextPane;
148 CAknTitlePane * iTitlePane;
149 CAknNavigationControlContainer * iNaviPane;
150 CAknNavigationDecorator * iNaviDecorator;
156 enum TFontUnderline iUnderLine;
160 #endif // __MAINVIEW_CONTAINER_H__