sl@0: /* sl@0: * Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: * All rights reserved. sl@0: * This component and the accompanying materials are made available sl@0: * under the terms of "Eclipse Public License v1.0" sl@0: * which accompanies this distribution, and is available sl@0: * at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: * sl@0: * Initial Contributors: sl@0: * Nokia Corporation - initial contribution. sl@0: * sl@0: * Contributors: sl@0: * sl@0: * Description: sl@0: * Series 60 version of Hindi Demo application sl@0: * sl@0: */ sl@0: sl@0: sl@0: sl@0: #ifndef __MAINVIEW_CONTAINER_H__ sl@0: #define __MAINVIEW_CONTAINER_H__ sl@0: sl@0: #include "HindiDemo.hrh" sl@0: sl@0: sl@0: #include sl@0: #include sl@0: #include sl@0: #include sl@0: #include sl@0: #include sl@0: #include sl@0: #include sl@0: #include sl@0: sl@0: const TInt KLengthOfNaviTempString = 100; sl@0: sl@0: // ----------------------------------------------------------------------- sl@0: // CMainViewContainer sl@0: // ----------------------------------------------------------------------- sl@0: class CMainViewContainer : public CCoeControl, public MCoeControlObserver { sl@0: sl@0: public: sl@0: // ----------------------------------------------------------------------- sl@0: // Creates a CMainViewContainer object sl@0: // ----------------------------------------------------------------------- sl@0: static CMainViewContainer * NewL(const TRect& aRect); sl@0: sl@0: // ----------------------------------------------------------------------- sl@0: // Creates a CMainViewView object sl@0: // ----------------------------------------------------------------------- sl@0: static CMainViewContainer * NewLC(const TRect& aRect); sl@0: sl@0: // ----------------------------------------------------------------------- sl@0: // Returns the number of controls contained in this compound control sl@0: // ----------------------------------------------------------------------- sl@0: TInt CountComponentControls() const; sl@0: sl@0: // ----------------------------------------------------------------------- sl@0: // Returns the component at the specified index sl@0: // @param aIndex specifies index of component sl@0: // @return Pointer to component control sl@0: // ----------------------------------------------------------------------- sl@0: CCoeControl * ComponentControl(TInt aIndex) const; sl@0: sl@0: // ----------------------------------------------------------------------- sl@0: // Draws this container sl@0: // ----------------------------------------------------------------------- sl@0: void Draw(const TRect& aRect) const; sl@0: void DrawHindiText(CWindowGc& aGc) const; sl@0: void DisableShaping(const TDesC* aInput, TDes& aOutput ) const; sl@0: void SetHindiFont( TFontSpec& aFontSpec ); sl@0: void ChangeSample( TInt aSample); sl@0: TInt GetSample(); sl@0: void SetFontSize( TInt aFontSize ); sl@0: TInt GetFontSize(); sl@0: void SetUnderLine( enum TFontUnderline aUnderLine ); sl@0: enum TFontUnderline GetUnderLine( ); sl@0: void ChangeFont(); sl@0: void ChangePreviousFont(); sl@0: void DisplayAvailableFonts(); sl@0: sl@0: // ----------------------------------------------------------------------- sl@0: // Destroys container sl@0: // ----------------------------------------------------------------------- sl@0: ~CMainViewContainer(); sl@0: sl@0: // sl@0: // Handler for events sent by a control to this Observer sl@0: // sl@0: void HandleControlEventL(CCoeControl * aControl, TCoeEvent aEventType); sl@0: sl@0: // -------------------------------------------------------------------------------------- sl@0: // Overridden function used to pass key events to child controls owned by this container sl@0: // -------------------------------------------------------------------------------------- sl@0: TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aType); sl@0: sl@0: // ----------------------------------------------------------------------- sl@0: // Routine that dispatches Command events to individual handlers sl@0: // ----------------------------------------------------------------------- sl@0: bool DispatchViewCommandEvents(TInt aCommand); sl@0: sl@0: private: sl@0: // ----------------------------------------------------------------------- sl@0: // Constructor sl@0: // ----------------------------------------------------------------------- sl@0: CMainViewContainer(); sl@0: sl@0: // ----------------------------------------------------------------------- sl@0: // Performs second phase construction of this Container sl@0: // ----------------------------------------------------------------------- sl@0: void ConstructL(const TRect & aRect); sl@0: sl@0: // ----------------------------------------------------------------------- sl@0: // Routine that initializes components owned by this Container sl@0: // ----------------------------------------------------------------------- sl@0: void InitComponentsL(); sl@0: sl@0: // ----------------------------------------------------------------------- sl@0: // Routine that cleans up components owned by this container sl@0: // ----------------------------------------------------------------------- sl@0: void CleanupComponents(); sl@0: sl@0: // ----------------------------------------------------------------------- sl@0: // Routine that attempts to dispatch Control Events sl@0: // ----------------------------------------------------------------------- sl@0: void DispatchControlEvents(CCoeControl * aControl, TCoeEvent aEventType); sl@0: sl@0: // ----------------------------------------------------------------------- sl@0: // Place holder routine to handle key events sl@0: // ----------------------------------------------------------------------- sl@0: bool HandleKeyEvents(const TKeyEvent& aKeyEvent, TEventCode aType); sl@0: sl@0: // ----------------------------------------------------------------------- sl@0: // Helper method to manage control in focus sl@0: // ----------------------------------------------------------------------- sl@0: void ChangeFocus(CCoeControl * aNewControl); sl@0: sl@0: private: sl@0: TRgb iBackgroundColor; sl@0: RPointerArray iCtrlArray; sl@0: CCoeControl* iFocusedControl; sl@0: sl@0: private: sl@0: // ----------------------------------------------------------------------------- sl@0: CAknContextPane * iContextPane; sl@0: CAknTitlePane * iTitlePane; sl@0: CAknNavigationControlContainer * iNaviPane; sl@0: CAknNavigationDecorator * iNaviDecorator; sl@0: sl@0: TInt iSample; sl@0: TFontSpec iFontSpec; sl@0: TInt iFontSize; sl@0: TInt iSelectedFont; sl@0: enum TFontUnderline iUnderLine; sl@0: sl@0: }; sl@0: sl@0: #endif // __MAINVIEW_CONTAINER_H__