os/textandloc/fontservices/textshaperplugin/test/S60HindiDemo/inc/MainViewcontainer.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.
sl@0
     1
/*
sl@0
     2
* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
sl@0
     3
* All rights reserved.
sl@0
     4
* This component and the accompanying materials are made available
sl@0
     5
* under the terms of "Eclipse Public License v1.0"
sl@0
     6
* which accompanies this distribution, and is available
sl@0
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
sl@0
     8
*
sl@0
     9
* Initial Contributors:
sl@0
    10
* Nokia Corporation - initial contribution.
sl@0
    11
*
sl@0
    12
* Contributors:
sl@0
    13
*
sl@0
    14
* Description: 
sl@0
    15
* Series 60 version of Hindi Demo application
sl@0
    16
*
sl@0
    17
*/
sl@0
    18
sl@0
    19
sl@0
    20
sl@0
    21
#ifndef __MAINVIEW_CONTAINER_H__
sl@0
    22
#define __MAINVIEW_CONTAINER_H__
sl@0
    23
sl@0
    24
#include "HindiDemo.hrh"
sl@0
    25
sl@0
    26
sl@0
    27
#include <eikappui.h>
sl@0
    28
#include <coecntrl.h>
sl@0
    29
#include <akncontext.h>
sl@0
    30
#include <aknnavi.h>
sl@0
    31
#include <aknnavide.h>
sl@0
    32
#include <akntitle.h>
sl@0
    33
#include <avkon.rsg>
sl@0
    34
#include <barsread.h>
sl@0
    35
#include <eikspane.h>
sl@0
    36
sl@0
    37
const TInt KLengthOfNaviTempString = 100;
sl@0
    38
sl@0
    39
// -----------------------------------------------------------------------
sl@0
    40
// CMainViewContainer
sl@0
    41
// -----------------------------------------------------------------------
sl@0
    42
class CMainViewContainer : public CCoeControl, public MCoeControlObserver {
sl@0
    43
sl@0
    44
public:
sl@0
    45
  // -----------------------------------------------------------------------
sl@0
    46
  // Creates a CMainViewContainer object
sl@0
    47
  // -----------------------------------------------------------------------
sl@0
    48
  static CMainViewContainer * NewL(const TRect& aRect);
sl@0
    49
sl@0
    50
  // -----------------------------------------------------------------------
sl@0
    51
  // Creates a CMainViewView object
sl@0
    52
  // -----------------------------------------------------------------------
sl@0
    53
  static CMainViewContainer * NewLC(const TRect& aRect);
sl@0
    54
sl@0
    55
  // -----------------------------------------------------------------------
sl@0
    56
  // Returns the number of controls contained in this compound control
sl@0
    57
  // -----------------------------------------------------------------------
sl@0
    58
  TInt CountComponentControls() const;
sl@0
    59
sl@0
    60
  // -----------------------------------------------------------------------
sl@0
    61
  // Returns the component at the specified index
sl@0
    62
  // @param aIndex specifies index of component
sl@0
    63
  // @return Pointer to component control
sl@0
    64
  // -----------------------------------------------------------------------
sl@0
    65
  CCoeControl * ComponentControl(TInt aIndex) const;
sl@0
    66
sl@0
    67
  // -----------------------------------------------------------------------
sl@0
    68
  // Draws this container
sl@0
    69
  // -----------------------------------------------------------------------
sl@0
    70
  	void Draw(const TRect& aRect) const;
sl@0
    71
  	void DrawHindiText(CWindowGc& aGc) const;
sl@0
    72
	void DisableShaping(const TDesC* aInput, TDes& aOutput ) const;
sl@0
    73
	void SetHindiFont( TFontSpec& aFontSpec );
sl@0
    74
	void ChangeSample( TInt aSample);
sl@0
    75
	TInt GetSample();
sl@0
    76
	void SetFontSize( TInt aFontSize );
sl@0
    77
	TInt GetFontSize();
sl@0
    78
	void SetUnderLine( enum TFontUnderline aUnderLine );
sl@0
    79
	enum TFontUnderline GetUnderLine( );
sl@0
    80
	void ChangeFont();
sl@0
    81
	void ChangePreviousFont();
sl@0
    82
	void DisplayAvailableFonts();
sl@0
    83
sl@0
    84
  	// -----------------------------------------------------------------------
sl@0
    85
  	// Destroys container
sl@0
    86
  	// -----------------------------------------------------------------------
sl@0
    87
  	~CMainViewContainer();
sl@0
    88
sl@0
    89
	//
sl@0
    90
	// Handler for events sent by a control to this Observer
sl@0
    91
	//
sl@0
    92
	void HandleControlEventL(CCoeControl * aControl, TCoeEvent aEventType);
sl@0
    93
sl@0
    94
  // --------------------------------------------------------------------------------------
sl@0
    95
  // Overridden function used to pass key events to child controls owned by this container
sl@0
    96
  // --------------------------------------------------------------------------------------
sl@0
    97
  TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aType);
sl@0
    98
sl@0
    99
  // -----------------------------------------------------------------------
sl@0
   100
  // Routine that dispatches Command events to individual handlers
sl@0
   101
  // -----------------------------------------------------------------------
sl@0
   102
  bool DispatchViewCommandEvents(TInt aCommand);
sl@0
   103
sl@0
   104
private:
sl@0
   105
  // -----------------------------------------------------------------------
sl@0
   106
  // Constructor
sl@0
   107
  // -----------------------------------------------------------------------
sl@0
   108
  CMainViewContainer();
sl@0
   109
sl@0
   110
  // -----------------------------------------------------------------------
sl@0
   111
  // Performs second phase construction of this Container
sl@0
   112
  // -----------------------------------------------------------------------
sl@0
   113
  void ConstructL(const TRect & aRect);
sl@0
   114
sl@0
   115
  // -----------------------------------------------------------------------
sl@0
   116
  // Routine that initializes components owned by this Container
sl@0
   117
  // -----------------------------------------------------------------------
sl@0
   118
  void InitComponentsL();
sl@0
   119
sl@0
   120
  // -----------------------------------------------------------------------
sl@0
   121
  // Routine that cleans up components owned by this container
sl@0
   122
  // -----------------------------------------------------------------------
sl@0
   123
  void CleanupComponents();
sl@0
   124
sl@0
   125
  // -----------------------------------------------------------------------
sl@0
   126
  // Routine that attempts to dispatch Control Events
sl@0
   127
  // -----------------------------------------------------------------------
sl@0
   128
  void DispatchControlEvents(CCoeControl * aControl, TCoeEvent aEventType);
sl@0
   129
sl@0
   130
  // -----------------------------------------------------------------------
sl@0
   131
  // Place holder routine to handle key events
sl@0
   132
  // -----------------------------------------------------------------------
sl@0
   133
  bool HandleKeyEvents(const TKeyEvent& aKeyEvent, TEventCode aType);
sl@0
   134
sl@0
   135
  // -----------------------------------------------------------------------
sl@0
   136
  // Helper method to manage control in focus
sl@0
   137
  // -----------------------------------------------------------------------
sl@0
   138
  void ChangeFocus(CCoeControl * aNewControl);
sl@0
   139
sl@0
   140
private:
sl@0
   141
  TRgb iBackgroundColor;
sl@0
   142
  RPointerArray<CCoeControl> iCtrlArray;
sl@0
   143
  CCoeControl* iFocusedControl;
sl@0
   144
sl@0
   145
private:
sl@0
   146
  // -----------------------------------------------------------------------------
sl@0
   147
  	CAknContextPane * iContextPane;
sl@0
   148
  	CAknTitlePane * iTitlePane;
sl@0
   149
  	CAknNavigationControlContainer * iNaviPane;
sl@0
   150
  	CAknNavigationDecorator * iNaviDecorator;
sl@0
   151
sl@0
   152
    TInt 		iSample;
sl@0
   153
    TFontSpec 	iFontSpec;
sl@0
   154
    TInt 		iFontSize;
sl@0
   155
    TInt		iSelectedFont;
sl@0
   156
	enum TFontUnderline iUnderLine;
sl@0
   157
sl@0
   158
};
sl@0
   159
sl@0
   160
#endif // __MAINVIEW_CONTAINER_H__