textinput/peninputhwrboxcn/ctrlinc/peninputhwrbxwnd.h
changeset 0 eb1f2e154e89
equal deleted inserted replaced
-1:000000000000 0:eb1f2e154e89
       
     1 /*
       
     2 * Copyright (c) 2002-2005 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:  boxbase hwr window
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef C_CAKNFEPHWRBXWND_H
       
    20 #define C_CAKNFEPHWRBXWND_H
       
    21 
       
    22 // INCLUDES
       
    23 #include <peninputbasewindow.h>
       
    24 #include "peninputhwrpropertysubscriber.h"
       
    25 
       
    26 // FORWARD DECLARATIONS
       
    27 class CFepInputContextField;
       
    28 class CAknFepCtrlButton;
       
    29 class CAknFepHwrBxCtrlBar;
       
    30 class CAknFepHwrBoxGroup;
       
    31 class CAknFepHwrBxDataStore;
       
    32 class CFepCtrlDropdownList;
       
    33 class TResourceReader;
       
    34 class CPeninputLayoutInputmodelChoice;
       
    35 class CAknFepCtrlRepeatButton;
       
    36 
       
    37 /**
       
    38  *  boxbased hwr window
       
    39  *
       
    40  *  @lib peninputhwrboxcn.lib
       
    41  *  @since S60 v3.2
       
    42  */
       
    43 class CAknFepHwrBxWnd : public CAknFepCtrlBaseWindow, public MAknFepHwrPropertySubscriber
       
    44     {
       
    45             
       
    46 public:
       
    47 
       
    48     /**
       
    49      * Symbian constructor.
       
    50      *
       
    51      * @since S60 v3.2
       
    52      * @param aUiLayout The layout
       
    53      * @param aControlId The control id
       
    54      * @param aLandscapeStyle Current screen is landscape or not
       
    55      * @return Pointer to created CAknFepHwrBxWnd object
       
    56      */
       
    57     static CAknFepHwrBxWnd* NewL(CFepUiLayout* aFepUiLayout, 
       
    58                                  TInt aControlId,
       
    59                                  TBool aLandscapeStyle);
       
    60                 
       
    61     /**
       
    62      * Symbian constructor.
       
    63      *
       
    64      * @since S60 v3.2
       
    65      * @param aUiLayout The layout
       
    66      * @param aControlId The control id
       
    67      * @param aLandscapeStyle Current screen is landscape or not
       
    68      * @return Pointer to created CAknFepHwrBxWnd object
       
    69      */
       
    70     static CAknFepHwrBxWnd* NewLC(CFepUiLayout* aFepUiLayout, 
       
    71                                   TInt aControlId,
       
    72                                   TBool aLandscapeStyle);
       
    73         
       
    74     /**
       
    75      * destructor.
       
    76      *
       
    77      * @since S60 v3.2
       
    78      * @return None
       
    79      */
       
    80     virtual ~CAknFepHwrBxWnd();
       
    81     
       
    82     /** 
       
    83      * ConstructFromResourceL load from resource.
       
    84      *
       
    85      * @since S60 v3.2
       
    86      * @param aReader A resource reader
       
    87      * @return None
       
    88      */
       
    89     void ConstructFromResourceL(TResourceReader& aReader); 
       
    90 
       
    91     /** 
       
    92      * ConstructFromResourceL load from resource.
       
    93      * Before calling this function, resource id should be set
       
    94      *
       
    95      * @since S60 v3.2
       
    96      * @return None
       
    97      */
       
    98     void ConstructFromResourceL(); 
       
    99 
       
   100     /**
       
   101      * Set the input context field text
       
   102      *
       
   103      * @since S60 v3.2
       
   104      * @param aTotalTextLen The total text length in editor
       
   105      * @param aStartPos The position of aText in whole editor
       
   106      * @param aCursorSel Current cursor selection
       
   107      * @param aText The text to be set 
       
   108      * @return None
       
   109      */          
       
   110     void SetEditorTextL(const TFepInputContextFieldData& aData);
       
   111 
       
   112     /**
       
   113      * Highlight the dropdown list cell
       
   114      *
       
   115      * @since S60 v3.2
       
   116      * @param aIndex The cell index
       
   117      * @return None
       
   118      */          
       
   119     void HighlightCell(TInt aIndex);
       
   120     
       
   121     /**
       
   122      * Cancel wrting
       
   123      *
       
   124      * @since S60 v3.2
       
   125      * @return None
       
   126      */          
       
   127     void CancelWriting();
       
   128     
       
   129     /**
       
   130      * Cancel repeat
       
   131      *
       
   132      * @since S60 v3.2
       
   133      * @return None
       
   134      */          
       
   135     void CancelRepeat();
       
   136     
       
   137     /**
       
   138      * Cancel repeat
       
   139      *
       
   140      * @since S60 v3.2
       
   141      * @param aFlag The dim flag
       
   142      * @return None
       
   143      */          
       
   144     void DimInputContextField(TBool aFlag);
       
   145     
       
   146     /**
       
   147      * Pup up pen input mode switcher
       
   148      *
       
   149      * @since S60 v3.2
       
   150      * @return None
       
   151      */          
       
   152     void PopUpPenInputModeSwitcher();
       
   153 
       
   154 // from base class CAknFepCtrlBaseWindow
       
   155 
       
   156     /**
       
   157      * From CAknFepCtrlBaseWindow.
       
   158      * Resize according to LAF
       
   159      *
       
   160      * @since S60 v3.2
       
   161      * @param aLandscapeStyle Current screen is landscape or not
       
   162      * @return None
       
   163      */          
       
   164     void SizeChanged(TBool aLandscapeStyle);
       
   165     
       
   166     /**
       
   167      * From CAknFepCtrlBaseWindow.
       
   168      * call back function when closing window
       
   169      *
       
   170      * @since S60 v3.2
       
   171      * @return ETrue for allowing close window; otherwise EFalse
       
   172      */          
       
   173     TBool DoClose();
       
   174 
       
   175 // from base class MAknFepHwrPropertySubscriber
       
   176 
       
   177     /**
       
   178      * From MAknFepHwrPropertySubscriber.
       
   179      * Handle the property change
       
   180      *
       
   181      * @since S60 v3.2
       
   182      * @param aPropertyName The property name 
       
   183      * @param aPropertyValue The new value
       
   184      * @return None
       
   185      */
       
   186     void SetPropertyL(const MAknFepHwrPropertySubscriber::TAknFepHwrProperty aPropertyName, 
       
   187                      const TDesC& aPropertyValue);
       
   188     
       
   189     /**
       
   190      * Draw window and shadow
       
   191      *
       
   192      * @since S60 v3.2
       
   193      * @return None
       
   194      */          
       
   195     void Draw();
       
   196     
       
   197     /**
       
   198      * Get drop down list
       
   199      *
       
   200      * @since S60 v3.2
       
   201      * @return Pointer to drop down list
       
   202      */          
       
   203     CFepCtrlDropdownList* DropdownList();
       
   204     
       
   205     TPoint StrokeEndMark();
       
   206 
       
   207     /**
       
   208      * Get top left shadow size
       
   209      *
       
   210      * @since S60 v3.2
       
   211      * @return Top left corner shadow size
       
   212      */          
       
   213     TSize ShadowTlSize();
       
   214     
       
   215     /**
       
   216      * Get bottom right shadow size
       
   217      *
       
   218      * @since S60 v3.2
       
   219      * @return Bottom right corner shadow size
       
   220      */          
       
   221     TSize ShadowBrSize();
       
   222     
       
   223     /**
       
   224      * Set if enable option button and language switch button
       
   225      *
       
   226      * @since S60 v3.2
       
   227      * @param aEnable The enable flag
       
   228      * @return None
       
   229      */ 
       
   230     void SetEnableSettingBtn(TBool aEnable);
       
   231     
       
   232     /**
       
   233      * Reset writting window
       
   234      *
       
   235      * @since S60 v3.2
       
   236      * @return None
       
   237      */ 
       
   238     void ResetWrittingWnd();
       
   239     
       
   240     void SetTextAlignmentL( TInt aAlignment );
       
   241     
       
   242 protected:
       
   243 
       
   244     /**
       
   245      * C++ default constructor
       
   246      *
       
   247      * @since S60 v3.2
       
   248      * @param aFepUiLayout A Ui Layout environment (CFepUiLayout)
       
   249      * @param aControlId Control id
       
   250      * @return None
       
   251      */          
       
   252     CAknFepHwrBxWnd(CFepUiLayout* aFepUiLayout, TInt aControlId);
       
   253     
       
   254 private:
       
   255 
       
   256     /**
       
   257      * Symbian second-phase constructor
       
   258      *
       
   259      * @since S60 v3.2
       
   260      * @param aLandscapeStyle Current screen is landscape or not
       
   261      * @return None
       
   262      */          
       
   263     void ConstructL(TBool aLandscapeStyle);
       
   264 
       
   265     /**
       
   266      * Add input context field to window
       
   267      *
       
   268      * @since S60 v3.2
       
   269      * @return None
       
   270      */
       
   271     void AddContextFieldL();
       
   272 
       
   273     /**
       
   274      * Add option button to window
       
   275      *
       
   276      * @since S60 v3.2
       
   277      * @return None
       
   278      */
       
   279     void AddOptionButtonL();
       
   280     
       
   281     /**
       
   282      * Add control bar to window
       
   283      *
       
   284      * @since S60 v3.2
       
   285      * @return None
       
   286      */
       
   287     void AddControlBarL();
       
   288     
       
   289     /**
       
   290      * Add box group to window
       
   291      *
       
   292      * @since S60 v3.2
       
   293      * @return None
       
   294      */
       
   295     void AddBoxGroupL();
       
   296     
       
   297     /**
       
   298      * Add dropdown list to window
       
   299      *
       
   300      * @since S60 v3.2
       
   301      * @param aLandscapeStyle Current screen is landscape or not
       
   302      * @return None
       
   303      */
       
   304     void AddDropdownListL(TBool aLandscapeStyle);
       
   305     
       
   306     /**
       
   307      * Read unit size, shadow size of hwr window
       
   308      *
       
   309      * @since S60 v3.2
       
   310      * @return None
       
   311      */
       
   312     void ReadLafInfo(TBool aLandscapeStyle);
       
   313     
       
   314     /**
       
   315      * Add backspace button to window
       
   316      *
       
   317      * @since S60 v3.2
       
   318      * @return None
       
   319      */
       
   320     void AddBackspaceBtnL();
       
   321     
       
   322     /**
       
   323      * read background info of base window
       
   324      *
       
   325      * @since S60 v3.2
       
   326      * @return None
       
   327      */   
       
   328     void ReadBackgroundInfoL( TInt aResId );
       
   329     
       
   330 private:// data
       
   331 
       
   332     /**
       
   333      * The input context field (Own)
       
   334      */
       
   335     CFepInputContextField* iContextField;
       
   336     
       
   337     /**
       
   338      * The touch input option button (Own)
       
   339      */
       
   340     CAknFepCtrlCommonButton* iOptionButton;
       
   341 
       
   342     /**
       
   343      * Instance of back space button (own)
       
   344      */
       
   345     CAknFepCtrlRepeatButton* iBackspace;       
       
   346     
       
   347     /**
       
   348      * The control bar (Own)
       
   349      */
       
   350     CAknFepHwrBxCtrlBar* iControlBar;
       
   351     
       
   352     /**
       
   353      * The drop down list control (Own)
       
   354      */    
       
   355     CFepCtrlDropdownList* iDropdownList;
       
   356      
       
   357     /**
       
   358      * The hwr box group (Own)
       
   359      */
       
   360     CAknFepHwrBoxGroup* iBoxGroup;
       
   361 
       
   362     /**
       
   363      * The data store (Not own)
       
   364      */
       
   365     CAknFepHwrBxDataStore* iDataStore;
       
   366     
       
   367     /**
       
   368      * The drop down list font (own)
       
   369      */
       
   370     // removed in 2006.02.10, font get from LAF now
       
   371     //CFont* iDropdownListFont;
       
   372     
       
   373     /**
       
   374      * second range color
       
   375      */
       
   376     TRgb iSecondRangeColor;
       
   377  
       
   378     /**
       
   379      * The unit width
       
   380      */
       
   381     TInt iUnitWidth;
       
   382 
       
   383     /**
       
   384      * The unit height
       
   385      */
       
   386     TInt iUnitHeight;
       
   387     
       
   388     /**
       
   389      * Size of top left shadow corner
       
   390      */
       
   391     TSize iShadowTl;
       
   392 
       
   393     /**
       
   394      * Size of bottom right shadow corner
       
   395      */
       
   396     TSize iShadowBr;
       
   397 
       
   398     /**
       
   399      * First time construct flag
       
   400      */
       
   401     TBool iFirstTimeConstruct;
       
   402     
       
   403     /**
       
   404      * Indicate whether unit size and shadow tl br size
       
   405      * have been set
       
   406      */
       
   407     TBool iUnitShadowSizeSet;
       
   408     
       
   409     /**
       
   410      * Indicate whether sub controls size and position
       
   411      * have been set
       
   412      */
       
   413     TBool iControlPosSet;
       
   414     
       
   415     CPeninputLayoutInputmodelChoice* iInputModeSwitch;    
       
   416     };
       
   417 
       
   418 #endif // C_CAKNFEPHWRBXWND_H
       
   419 
       
   420 // End Of File