os/textandloc/fontservices/textshaperplugin/test/S60HindiDemo/inc/MainViewcontainer.h
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/textandloc/fontservices/textshaperplugin/test/S60HindiDemo/inc/MainViewcontainer.h Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,160 @@
1.4 +/*
1.5 +* Copyright (c) 2005-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 +* Series 60 version of Hindi Demo application
1.19 +*
1.20 +*/
1.21 +
1.22 +
1.23 +
1.24 +#ifndef __MAINVIEW_CONTAINER_H__
1.25 +#define __MAINVIEW_CONTAINER_H__
1.26 +
1.27 +#include "HindiDemo.hrh"
1.28 +
1.29 +
1.30 +#include <eikappui.h>
1.31 +#include <coecntrl.h>
1.32 +#include <akncontext.h>
1.33 +#include <aknnavi.h>
1.34 +#include <aknnavide.h>
1.35 +#include <akntitle.h>
1.36 +#include <avkon.rsg>
1.37 +#include <barsread.h>
1.38 +#include <eikspane.h>
1.39 +
1.40 +const TInt KLengthOfNaviTempString = 100;
1.41 +
1.42 +// -----------------------------------------------------------------------
1.43 +// CMainViewContainer
1.44 +// -----------------------------------------------------------------------
1.45 +class CMainViewContainer : public CCoeControl, public MCoeControlObserver {
1.46 +
1.47 +public:
1.48 + // -----------------------------------------------------------------------
1.49 + // Creates a CMainViewContainer object
1.50 + // -----------------------------------------------------------------------
1.51 + static CMainViewContainer * NewL(const TRect& aRect);
1.52 +
1.53 + // -----------------------------------------------------------------------
1.54 + // Creates a CMainViewView object
1.55 + // -----------------------------------------------------------------------
1.56 + static CMainViewContainer * NewLC(const TRect& aRect);
1.57 +
1.58 + // -----------------------------------------------------------------------
1.59 + // Returns the number of controls contained in this compound control
1.60 + // -----------------------------------------------------------------------
1.61 + TInt CountComponentControls() const;
1.62 +
1.63 + // -----------------------------------------------------------------------
1.64 + // Returns the component at the specified index
1.65 + // @param aIndex specifies index of component
1.66 + // @return Pointer to component control
1.67 + // -----------------------------------------------------------------------
1.68 + CCoeControl * ComponentControl(TInt aIndex) const;
1.69 +
1.70 + // -----------------------------------------------------------------------
1.71 + // Draws this container
1.72 + // -----------------------------------------------------------------------
1.73 + void Draw(const TRect& aRect) const;
1.74 + void DrawHindiText(CWindowGc& aGc) const;
1.75 + void DisableShaping(const TDesC* aInput, TDes& aOutput ) const;
1.76 + void SetHindiFont( TFontSpec& aFontSpec );
1.77 + void ChangeSample( TInt aSample);
1.78 + TInt GetSample();
1.79 + void SetFontSize( TInt aFontSize );
1.80 + TInt GetFontSize();
1.81 + void SetUnderLine( enum TFontUnderline aUnderLine );
1.82 + enum TFontUnderline GetUnderLine( );
1.83 + void ChangeFont();
1.84 + void ChangePreviousFont();
1.85 + void DisplayAvailableFonts();
1.86 +
1.87 + // -----------------------------------------------------------------------
1.88 + // Destroys container
1.89 + // -----------------------------------------------------------------------
1.90 + ~CMainViewContainer();
1.91 +
1.92 + //
1.93 + // Handler for events sent by a control to this Observer
1.94 + //
1.95 + void HandleControlEventL(CCoeControl * aControl, TCoeEvent aEventType);
1.96 +
1.97 + // --------------------------------------------------------------------------------------
1.98 + // Overridden function used to pass key events to child controls owned by this container
1.99 + // --------------------------------------------------------------------------------------
1.100 + TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aType);
1.101 +
1.102 + // -----------------------------------------------------------------------
1.103 + // Routine that dispatches Command events to individual handlers
1.104 + // -----------------------------------------------------------------------
1.105 + bool DispatchViewCommandEvents(TInt aCommand);
1.106 +
1.107 +private:
1.108 + // -----------------------------------------------------------------------
1.109 + // Constructor
1.110 + // -----------------------------------------------------------------------
1.111 + CMainViewContainer();
1.112 +
1.113 + // -----------------------------------------------------------------------
1.114 + // Performs second phase construction of this Container
1.115 + // -----------------------------------------------------------------------
1.116 + void ConstructL(const TRect & aRect);
1.117 +
1.118 + // -----------------------------------------------------------------------
1.119 + // Routine that initializes components owned by this Container
1.120 + // -----------------------------------------------------------------------
1.121 + void InitComponentsL();
1.122 +
1.123 + // -----------------------------------------------------------------------
1.124 + // Routine that cleans up components owned by this container
1.125 + // -----------------------------------------------------------------------
1.126 + void CleanupComponents();
1.127 +
1.128 + // -----------------------------------------------------------------------
1.129 + // Routine that attempts to dispatch Control Events
1.130 + // -----------------------------------------------------------------------
1.131 + void DispatchControlEvents(CCoeControl * aControl, TCoeEvent aEventType);
1.132 +
1.133 + // -----------------------------------------------------------------------
1.134 + // Place holder routine to handle key events
1.135 + // -----------------------------------------------------------------------
1.136 + bool HandleKeyEvents(const TKeyEvent& aKeyEvent, TEventCode aType);
1.137 +
1.138 + // -----------------------------------------------------------------------
1.139 + // Helper method to manage control in focus
1.140 + // -----------------------------------------------------------------------
1.141 + void ChangeFocus(CCoeControl * aNewControl);
1.142 +
1.143 +private:
1.144 + TRgb iBackgroundColor;
1.145 + RPointerArray<CCoeControl> iCtrlArray;
1.146 + CCoeControl* iFocusedControl;
1.147 +
1.148 +private:
1.149 + // -----------------------------------------------------------------------------
1.150 + CAknContextPane * iContextPane;
1.151 + CAknTitlePane * iTitlePane;
1.152 + CAknNavigationControlContainer * iNaviPane;
1.153 + CAknNavigationDecorator * iNaviDecorator;
1.154 +
1.155 + TInt iSample;
1.156 + TFontSpec iFontSpec;
1.157 + TInt iFontSize;
1.158 + TInt iSelectedFont;
1.159 + enum TFontUnderline iUnderLine;
1.160 +
1.161 +};
1.162 +
1.163 +#endif // __MAINVIEW_CONTAINER_H__