fep/aknfep/src/aknfepuispellinputpane.cpp
changeset 40 2cb9bae34d17
parent 31 f1bdd6b078d1
child 49 37f5d84451bd
equal deleted inserted replaced
31:f1bdd6b078d1 40:2cb9bae34d17
     1 /*
       
     2 * Copyright (c)  Nokia Corporation and/or its subsidiary(-ies). 
       
     3 * All rights reserved.
       
     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".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:            Provides the CAknFepUiSpellInputPane methods.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 
       
    22 
       
    23 
       
    24 
       
    25 
       
    26 
       
    27 
       
    28 
       
    29 #include <eikgted.h>            // for CEikGlobalTextEditor
       
    30 #include <eikedwob.h>           // for MEikEdwinObserver
       
    31 #include <eikenv.h>             // for CEikonEnv
       
    32 #include <barsread.h>           // for TResourceReader
       
    33 #include <eiklabel.h>           // for CEikLable
       
    34 #include <AknUtils.h>
       
    35 #include <eikedwin.h> 
       
    36 #include <appapaclayout.cdl.h>        // for Layout stuff
       
    37 #include <aknlayoutscalable_apps.cdl.h>
       
    38 #include <StringLoader.h>
       
    39 
       
    40 #include "aknfepuispellinputpane.h"
       
    41 
       
    42 // CONSTANTS
       
    43 const TInt KNumberOfControl = 1;
       
    44 const TInt KSpellMaxLength = 32;    
       
    45 const TInt KTouchSpellEditorMaxLine = 1;  
       
    46 // Enumarations
       
    47 enum TControls
       
    48     {
       
    49     EInputWin
       
    50     };
       
    51 
       
    52 // ================= MEMBER FUNCTIONS ======================
       
    53 
       
    54 // ---------------------------------------------------------------------------
       
    55 // CAknFepUiSpellInputPane::CAknFepUiSpellInputPane
       
    56 // (other items were commented in a header)
       
    57 // ---------------------------------------------------------------------------
       
    58 // 
       
    59 CAknFepUiSpellInputPane::CAknFepUiSpellInputPane()
       
    60 :iInputWin( NULL )
       
    61 {
       
    62 } 
       
    63 
       
    64 // ---------------------------------------------------------------------------
       
    65 // CAknFepUiSpellInputPane::CAknFepUiSpellInputPane
       
    66 // (other items were commented in a header)
       
    67 // ---------------------------------------------------------------------------
       
    68 // 
       
    69 void CAknFepUiSpellInputPane::ConstructL( CCoeControl* aParent, 
       
    70     const TInt aEditorFlag, const TInt aEditorCase, 
       
    71     const TInt aEditorSCTResID )
       
    72 {
       
    73     // Create as a child window of the specified parent control's window.
       
    74     CreateWindowL( aParent );
       
    75     
       
    76     SetMopParent(aParent);
       
    77 
       
    78     // Create input editor
       
    79     iInputWin = new ( ELeave ) CEikEdwin;
       
    80     // Initialize the editor
       
    81     iInputWin->SetContainerWindowL( *this );
       
    82     iInputWin->ConstructL(0,0,0,KTouchSpellEditorMaxLine);
       
    83     
       
    84     iInputWin->SetAknEditorInputMode(EAknEditorTextInputMode);
       
    85     iInputWin->SetAknEditorSpecialCharacterTable(aEditorSCTResID);
       
    86     iInputWin->SetAknEditorFlags(iInputWin->AknEdwinFlags() | 
       
    87         aEditorFlag | EAknEditorFlagNoT9);
       
    88     iInputWin->SetAknEditorCase(aEditorCase);
       
    89 	iInputWin->SetMaxLength(KSpellMaxLength);
       
    90     iInputWin->SetMopParent(this);
       
    91     iInputWin->SetFocus( EFalse );
       
    92 
       
    93     iInputWin->ActivateL();
       
    94 
       
    95     ActivateL();
       
    96 }
       
    97 
       
    98 // ---------------------------------------------------------------------------
       
    99 // CAknFepUiSpellInputPane::NewL
       
   100 // (other items were commented in a header)
       
   101 // ---------------------------------------------------------------------------
       
   102 // 
       
   103 CAknFepUiSpellInputPane* CAknFepUiSpellInputPane::NewL(
       
   104     CCoeControl* aParent, const TInt aEditorFlag, 
       
   105     const TInt aEditorCase, const TInt aEditorSCTResID)
       
   106     {
       
   107     CAknFepUiSpellInputPane* self = new ( ELeave ) CAknFepUiSpellInputPane;
       
   108     
       
   109     CleanupStack::PushL( self );
       
   110     self->ConstructL( aParent, aEditorFlag, aEditorCase, aEditorSCTResID );
       
   111     CleanupStack::Pop();
       
   112     
       
   113     return self;
       
   114     }
       
   115 
       
   116 // ---------------------------------------------------------------------------
       
   117 // CAknFepUiSpellInputPane::~CAknFepUiSpellInputPane
       
   118 // (other items were commented in a header)
       
   119 // ---------------------------------------------------------------------------
       
   120 // 
       
   121 CAknFepUiSpellInputPane::~CAknFepUiSpellInputPane()
       
   122     {
       
   123     delete iInputWin;
       
   124     iInputWin = NULL;
       
   125     }
       
   126 
       
   127 // ---------------------------------------------------------------------------
       
   128 // CAknFepUiSpellInputPane::InputWin
       
   129 // (other items were commented in a header)
       
   130 // ---------------------------------------------------------------------------
       
   131 // 
       
   132 CEikEdwin* CAknFepUiSpellInputPane::InputWin() const
       
   133     {
       
   134     return iInputWin;
       
   135     }
       
   136 
       
   137 // ---------------------------------------------------------------------------
       
   138 // CAknFepUiSpellInputPane::SetInputWinObserver
       
   139 // (other items were commented in a header)
       
   140 // ---------------------------------------------------------------------------
       
   141 // 
       
   142 void CAknFepUiSpellInputPane::SetInputWinObserver( MEikEdwinObserver* aObserver )
       
   143     {
       
   144     iInputWin->SetEdwinObserver( aObserver );
       
   145     }
       
   146 
       
   147 
       
   148 // ---------------------------------------------------------------------------
       
   149 // CAknFepUiSpellInputPane::SetInputWinTextL
       
   150 // (other items were commented in a header)
       
   151 // ---------------------------------------------------------------------------
       
   152 // 
       
   153 void CAknFepUiSpellInputPane::SetInputWinTextL( const TDesC* aDes )
       
   154     {
       
   155     iInputWin->SetTextL( aDes );
       
   156     }
       
   157 
       
   158 // ---------------------------------------------------------------------------
       
   159 // CAknFepUiSpellInputPane::SelectAllL
       
   160 // (other items were commented in a header)
       
   161 // ---------------------------------------------------------------------------
       
   162 // 
       
   163 void CAknFepUiSpellInputPane::SelectAllL()
       
   164     {
       
   165     iInputWin->SelectAllL();
       
   166     }
       
   167 
       
   168 // ---------------------------------------------------------------------------
       
   169 // CAknFepUiSpellInputPane::InputCapabilities
       
   170 // (other items were commented in a header)
       
   171 // ---------------------------------------------------------------------------
       
   172 // 
       
   173 TCoeInputCapabilities CAknFepUiSpellInputPane::InputCapabilities() const
       
   174     {
       
   175     if (iInputWin->IsFocused())
       
   176         {
       
   177         return iInputWin->InputCapabilities();
       
   178         }
       
   179 
       
   180     return ENone;
       
   181     }
       
   182 
       
   183 // ---------------------------------------------------------------------------
       
   184 // CAknFepUiSpellInputPane::OfferKeyEventL
       
   185 // (other items were commented in a header)
       
   186 // ---------------------------------------------------------------------------
       
   187 // 
       
   188 TKeyResponse CAknFepUiSpellInputPane::OfferKeyEventL(
       
   189             const TKeyEvent& aKeyEvent, TEventCode aType )
       
   190     {
       
   191     if (iInputWin->IsFocused())
       
   192         {
       
   193         return iInputWin->OfferKeyEventL( aKeyEvent, aType );
       
   194         }
       
   195 
       
   196     return EKeyWasNotConsumed;
       
   197     }
       
   198 
       
   199 // ---------------------------------------------------------------------------
       
   200 // CAknFepUiSpellInputPane::CountComponentControls
       
   201 // (other items were commented in a header)
       
   202 // ---------------------------------------------------------------------------
       
   203 // 
       
   204 TInt CAknFepUiSpellInputPane::CountComponentControls() const
       
   205     {
       
   206     return KNumberOfControl;
       
   207     }
       
   208 
       
   209 // ---------------------------------------------------------------------------
       
   210 // CAknFepUiSpellInputPane::ComponentControl
       
   211 // (other items were commented in a header)
       
   212 // ---------------------------------------------------------------------------
       
   213 // 
       
   214 CCoeControl* CAknFepUiSpellInputPane::ComponentControl( TInt aIndex ) const
       
   215     {
       
   216     switch ( aIndex )
       
   217         {
       
   218         case EInputWin:
       
   219             {
       
   220             return iInputWin;
       
   221             }
       
   222         default:
       
   223             {
       
   224             return NULL;
       
   225             }
       
   226         }
       
   227     }
       
   228 
       
   229 // ---------------------------------------------------------------------------
       
   230 // CAknFepUiSpellInputPane::Draw
       
   231 // (other items were commented in a header)
       
   232 // ---------------------------------------------------------------------------
       
   233 // 
       
   234 void CAknFepUiSpellInputPane::Draw( const TRect& /*aRect*/ ) const
       
   235     {
       
   236     }
       
   237 
       
   238 // ---------------------------------------------------------------------------
       
   239 // CAknFepUiSpellInputPane::FocusChanged
       
   240 // (other items were commented in a header)
       
   241 // ---------------------------------------------------------------------------
       
   242 // 
       
   243 void CAknFepUiSpellInputPane::FocusChanged( TDrawNow aDrawNow )
       
   244     {
       
   245     iInputWin->SetFocus( IsFocused(), aDrawNow );
       
   246     }
       
   247 
       
   248 // ---------------------------------------------------------------------------
       
   249 // CAknFepUiSpellInputPane::SizeChanged
       
   250 // (other items were commented in a header)
       
   251 // ---------------------------------------------------------------------------
       
   252 // 
       
   253 void CAknFepUiSpellInputPane::SizeChanged()
       
   254 	{
       
   255     }
       
   256 
       
   257 // End of File