textinput/peninputhwrtrui/inc/truitextsettingpagecontainer.h
changeset 27 694fa80c203c
parent 24 fc42a86c98e3
child 35 0f326f2e628e
equal deleted inserted replaced
24:fc42a86c98e3 27:694fa80c203c
     1 /*
       
     2 * Copyright (c) 2007 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:  CTruiTextSettingPageContainer class of TrainingUI
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef C_TRUITEXTSETTINGPAGECONTAINER_H
       
    20 #define C_TRUITEXTSETTINGPAGECONTAINER_H
       
    21 
       
    22 #include <akntextsettingpage.h>
       
    23 #include <AknPreviewPopUpObserver.h>
       
    24 
       
    25 class CTruiHwrBox;
       
    26 class CAknPreviewPopUpController;
       
    27 
       
    28 class CTruiTextSettingPageContainer : public CAknTextSettingPage,
       
    29                                       public MAknPreviewPopUpObserver
       
    30     {
       
    31 public:
       
    32 
       
    33     /**
       
    34      * Two-phased constructor.
       
    35      * @param aResourceId Resource Id of CAknTextSettingPage
       
    36      * @param aText Reference to text for editing
       
    37      * @param aEnableHwrBox Indicate whether to open HWR box to preview model
       
    38      *        assigned to the shortcut text
       
    39      * @param aTextSettingPageFlags option flags for miscellaneous things
       
    40      * @return Pointer to the component control
       
    41      */
       
    42     static CTruiTextSettingPageContainer* NewL( TInt aResourceId, 
       
    43                                                 TDes& aText, 
       
    44                                                 const TRect& aRect,
       
    45                                                 TBool aEnableHwrBox = EFalse, 
       
    46                                                 TInt aTextSettingPageFlags = 0 );
       
    47     
       
    48     /**
       
    49      * Two-phased constructor.
       
    50      * @param aResourceId Resource Id of CAknTextSettingPage
       
    51      * @param aText Reference to text for editing
       
    52      * @param aEnableHwrBox Indicate whether to open HWR box to preview model
       
    53      *        assigned to the shortcut text
       
    54      * @param aTextSettingPageFlags option flags for miscellaneous things
       
    55      * @return Pointer to the component control
       
    56      */
       
    57     static CTruiTextSettingPageContainer* NewLC( TInt aResourceId, 
       
    58                                                  TDes& aText, 
       
    59                                                  const TRect& aRect,
       
    60                                                  TBool aEnableHwrBox = EFalse,
       
    61                                                  TInt aTextSettingPageFlags = 0 );
       
    62 
       
    63     /**
       
    64      * Destructor.
       
    65      */
       
    66     virtual ~CTruiTextSettingPageContainer();
       
    67 
       
    68 private:    
       
    69     /**
       
    70     * Constructor.
       
    71 	* @param aSettingPageResourceId	Setting Page to use (if present)
       
    72 	* @param aText						Reference to text for editing
       
    73 	* @param aTextSettingPageFlags		option flags for miscellaneous things    
       
    74     */
       
    75     CTruiTextSettingPageContainer( TInt aResourceID, TDes& aText, TInt aTextSettingPageFlags = 0 );
       
    76 
       
    77    /**
       
    78     * Perform the second phase construction of a CTruiMainViewContainer object.
       
    79     *
       
    80     * @param aEnableHwrBox Indicate whether to open HWR box to preview model
       
    81     *        assigned to the shortcut text    
       
    82     */
       
    83     void ConstructL( const TRect& aRect, TBool aEnableHwrBox = EFalse );      
       
    84     
       
    85     /**
       
    86      * From CoeControl.
       
    87      * Responds to changes to the size and position of the contents of this control.
       
    88      */
       
    89     void SizeChanged();
       
    90     
       
    91     /**
       
    92      * From CAknSettingPage
       
    93      * Processes events from the softkeys.     
       
    94      *
       
    95      * @param	aCommandId	Event Id from the soft-key
       
    96      */
       
    97 	void ProcessCommandL( TInt aCommandId );
       
    98 	
       
    99 // from MAknPreviewPopUpObserver
       
   100     /**    
       
   101     * Called by the preview popup when an appropriate event takes place. 
       
   102     * @param aController Pointer to the sender of the event.
       
   103     * @param aEvent Event type.
       
   104     */
       
   105     void HandlePreviewPopUpEventL(
       
   106           CAknPreviewPopUpController* aController, TPreviewPopUpEvent aEvent );
       
   107 
       
   108 private: // data    
       
   109     /**
       
   110      * Pointer to HWR box.
       
   111      * Own
       
   112      */
       
   113     CTruiHwrBox* iHwrBox;
       
   114     
       
   115     /**
       
   116      * Pointer to preview popup used to show tooltip
       
   117      * Own
       
   118      */
       
   119     CAknPreviewPopUpController* iPopupController;
       
   120     };
       
   121     
       
   122 #endif // C_TRUITEXTSETTINGPAGECONTAINER_H