extras/calcsoft/inc/CalcFunc.h
branchRCL_3
changeset 19 99b535de1dda
parent 0 3ee3dfdd8d69
equal deleted inserted replaced
17:a616540b95d9 19:99b535de1dda
    43 const TInt KMaxNumCharsPerCase = 50;
    43 const TInt KMaxNumCharsPerCase = 50;
    44 
    44 
    45 //  FORWARD DECLARATIONS
    45 //  FORWARD DECLARATIONS
    46 //class   CCalcCommandButton;
    46 //class   CCalcCommandButton;
    47 //Use of new AknButtons
    47 //Use of new AknButtons
    48 class 	CAknButton;
    48 class     CAknButton;
    49 class   CCalcContainer;
    49 class   CCalcContainer;
    50 class   CCalcAppEnv;
    50 class   CCalcAppEnv;
    51 class   CPtiEngine;
    51 class   CPtiEngine;
    52 class   CPtiQwertyKeyMappings;
    52 class   CPtiQwertyKeyMappings;
    53 class 	CPtiCoreLanguage;
    53 class     CPtiCoreLanguage;
    54 #ifdef RD_INTELLIGENT_TEXT_INPUT 
    54 #ifdef RD_INTELLIGENT_TEXT_INPUT 
    55 class   CPtiHalfQwertyKeyMappings;
    55 class   CPtiHalfQwertyKeyMappings;
    56 #endif
    56 #endif
    57 
    57 
    58 //  CLASS DEFINITIONS 
    58 //  CLASS DEFINITIONS 
    59 
    59 
    60 /**
    60 /**
    61 CCalcFuncmapSubPane : 'FunctionMap Sub-Pane' class
    61 CCalcFuncmapSubPane : 'FunctionMap Sub-Pane' class
    62 										: Class also derived from MCoeControlObserver to get events
    62                                         : Class also derived from MCoeControlObserver to get events
    63 										  from Avkon buttons
    63                                           from Avkon buttons
    64 */
    64 */
    65 class   CCalcFuncmapSubPane
    65 class   CCalcFuncmapSubPane
    66         :public CCoeControl , public MCoeControlObserver
    66         :public CCoeControl , public MCoeControlObserver
    67     {
    67     {
    68    public:
    68    public:
    71             {
    71             {
    72                ECmdTCancel = 0,   
    72                ECmdTCancel = 0,   
    73                ECmdTSeven,        
    73                ECmdTSeven,        
    74                ECmdTFour,         
    74                ECmdTFour,         
    75                ECmdTOne,          
    75                ECmdTOne,          
    76 			   ECmdTZero,         
    76                ECmdTZero,         
    77 			   ECmdTSqrt, 		 
    77                ECmdTSqrt,          
    78                ECmdTEight,        
    78                ECmdTEight,        
    79                ECmdTFive,         
    79                ECmdTFive,         
    80                ECmdTTwo,          
    80                ECmdTTwo,          
    81 			   ECmdTSeparator,    
    81                ECmdTSeparator,    
    82 			   ECmdTPercent,		 
    82                ECmdTPercent,         
    83 			   ECmdTNine,         
    83                ECmdTNine,         
    84                ECmdTSix,          
    84                ECmdTSix,          
    85                ECmdTThree,        
    85                ECmdTThree,        
    86                ECmdTChangeSign,   
    86                ECmdTChangeSign,   
    87                ECmdTDivide,       
    87                ECmdTDivide,       
    88                ECmdTMultiply,     
    88                ECmdTMultiply,     
    99             {
    99             {
   100             EPlusButton,            // +
   100             EPlusButton,            // +
   101             EMinusButton,           // -
   101             EMinusButton,           // -
   102             EMultiplyButton,        // *
   102             EMultiplyButton,        // *
   103             EDivideButton,          // /
   103             EDivideButton,          // /
   104 			EChangeSignButton,      // +/-
   104             EChangeSignButton,      // +/-
   105             EEqualButton,           // =
   105             EEqualButton,           // =
   106 			ESqrtButton,			// sqrt
   106             ESqrtButton,            // sqrt
   107 			EPercentButton,			// %
   107             EPercentButton,            // %
   108 			EScrollUp,              // << 
   108             EScrollUp,              // << 
   109             EScrollDown             // >> 
   109             EScrollDown             // >> 
   110             };
   110             };
   111    public:  // Constructors and destructor
   111    public:  // Constructors and destructor
   112         /**
   112         /**
   113         * Two-phased constructor.
   113         * Two-phased constructor.
   130         /**
   130         /**
   131         * Redraw ChangeSign button on ChangeSign enable.
   131         * Redraw ChangeSign button on ChangeSign enable.
   132         * @param aEnable : Flag of ChangeSign enable
   132         * @param aEnable : Flag of ChangeSign enable
   133         */
   133         */
   134         void SetChangeSignEnable(TBool aEnable);
   134         void SetChangeSignEnable(TBool aEnable);
   135 		
   135         
   136 		/**
   136         /**
   137         * Redraw Sqrt button on Sqrt enable.
   137         * Redraw Sqrt button on Sqrt enable.
   138         * @param aEnable : Flag of SqrtEnable enable
   138         * @param aEnable : Flag of SqrtEnable enable
   139         */
   139         */
   140 		void SetSqrtEnable (TBool aEnable);
   140         void SetSqrtEnable (TBool aEnable);
   141 
   141 
   142         /**
   142         /**
   143         * Redraw Clear button on Clear enable.
   143         * Redraw Clear button on Clear enable.
   144         * @param aEnable : Flag of ClearEnable enable
   144         * @param aEnable : Flag of ClearEnable enable
   145         */
   145         */
   146         void SetClearKeyEnable( TBool aEnable );
   146         void SetClearKeyEnable( TBool aEnable );
   147 		
   147         
   148 		/**
   148         /**
   149         * Redraw Sqrt button on Percent enable.
   149         * Redraw Sqrt button on Percent enable.
   150         * @param aEnable : Flag of PercentEnable enable
   150         * @param aEnable : Flag of PercentEnable enable
   151         */
   151         */
   152 		void SetPercentEnable(TBool aEnable);
   152         void SetPercentEnable(TBool aEnable);
   153 
   153 
   154 		/**
   154         /**
   155         * If no key is pressed until timeout of *-key,
   155         * If no key is pressed until timeout of *-key,
   156         * this function is called.
   156         * this function is called.
   157         */
   157         */
   158         void NotifyTimeoutL();
   158         void NotifyTimeoutL();
   159 
   159 
   184         /**
   184         /**
   185         * Called to find Key is long Pressed.
   185         * Called to find Key is long Pressed.
   186         * 
   186         * 
   187         */
   187         */
   188         TBool IsKeyLongPressed();
   188         TBool IsKeyLongPressed();
   189 
   189         
   190         
   190         /**
       
   191         * Called  when an error is displayed.
       
   192         * @param aErrorCode : an error code  from  CCalcContainer
       
   193         */
       
   194         void SetErrorCode(TInt aErrorCode);
       
   195         
       
   196         /**
       
   197         * Called  when there is a release event  .
       
   198         * @param aErrorCode : an error code ,it used to display dialog
       
   199         */
       
   200         void ErrorMsgL(TInt aErrorCode);
   191     public:   // Functions from base classes
   201     public:   // Functions from base classes
   192     
   202     
   193         /**
   203         /**
   194         * From MCoeControlObserver.
   204         * From MCoeControlObserver.
   195         * Handles events from Avkon Buttons
   205         * Handles events from Avkon Buttons
   202         * @return EKeyWasConsumed    : Key event was used
   212         * @return EKeyWasConsumed    : Key event was used
   203         *         EKeyWasNotConsumed : Key event was not used
   213         *         EKeyWasNotConsumed : Key event was not used
   204         */
   214         */
   205         TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aType);
   215         TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aType);
   206 
   216 
   207 		/**
   217         /**
   208 		*Refresh with latest button Icons when the skin change event has occured.
   218         *Refresh with latest button Icons when the skin change event has occured.
   209 	    */
   219         */
   210 		void RefreshButtonIcons();
   220         void RefreshButtonIcons();
   211 		
   221         
   212 		 /**
   222          /**
   213         * CCalcFuncmapSubPane::GetButtonBitmapControl
   223         * CCalcFuncmapSubPane::GetButtonBitmapControl
   214 		* This function is called when the size changes.
   224         * This function is called when the size changes.
   215         * 
   225         * 
   216         */
   226         */
   217 		    CAknButton* GetButtonBitmapControl(TInt aIndex); //Return iButtons
   227             CAknButton* GetButtonBitmapControl(TInt aIndex); //Return iButtons
   218 		
   228         
   219 		 /**
   229          /**
   220         * From CCoeControl : Handling pointer event
   230         * From CCoeControl : Handling pointer event
   221         * Handles all pen input events on function pane.
   231         * Handles all pen input events on function pane.
   222         * 
   232         * 
   223         */
   233         */
   224         void HandlePointerEventL
   234         void HandlePointerEventL
   233         * HandleMiddleSoftKeyOREKeyOK
   243         * HandleMiddleSoftKeyOREKeyOK
   234         * Called to handle MSK or EKeyOk
   244         * Called to handle MSK or EKeyOk
   235         */
   245         */
   236         void HandleMiddleSoftKeyOREKeyOKL();             
   246         void HandleMiddleSoftKeyOREKeyOKL();             
   237 
   247 
   238 				/**
   248                 /**
   239         * GetChangeSignButtonState
   249         * GetChangeSignButtonState
   240         * Gets the state of the Sign Button
   250         * Gets the state of the Sign Button
   241         */
   251         */
   242         TBool GetChangeSignButtonState();
   252         TBool GetChangeSignButtonState();
   243         
   253         
   244         
   254         
   245 				/**
   255                 /**
   246         * GetSqrtButtonState
   256         * GetSqrtButtonState
   247         * Gets the state of the Squareroot Button
   257         * Gets the state of the Squareroot Button
   248         */
   258         */
   249         TBool GetSqrtButtonState();
   259         TBool GetSqrtButtonState();
   250         
   260         
   317         * An old highlight rectangle and 
   327         * An old highlight rectangle and 
   318         * a new highlight rectangle are redrawn.
   328         * a new highlight rectangle are redrawn.
   319         * @param aOldId : The button chosen before
   329         * @param aOldId : The button chosen before
   320         * @param aNewId : The button chosen newly
   330         * @param aNewId : The button chosen newly
   321         */
   331         */
   322         void RedrawHighlight(TUint aOldId, TUint aNewId) const;
   332         void RedrawHighlight(TUint aOldId, TUint aNewId) ;
       
   333         
       
   334         /**
       
   335         * An old highlight rectangle and 
       
   336         * a new highlight rectangle are redrawn.
       
   337         * @param aOldId : The button chosen before
       
   338         * @param aNewId : The button chosen newly
       
   339         * @param aShowHightlight: control hightlight display
       
   340         */
       
   341         void RedrawHighlight(TUint aOldId, TUint aNewId,TBool aShowHightlight) ;
   323         
   342         
   324         /**
   343         /**
   325         * Set functionmap button layout. 
   344         * Set functionmap button layout. 
   326         */
   345         */
   327         void SetLayout();
   346         void SetLayout();
   381         TUint iLastKeyCode;             // The key code inputted at the last.
   400         TUint iLastKeyCode;             // The key code inputted at the last.
   382         CCalcContainer* iContainer;    // Pointer of CCalcContainer class 
   401         CCalcContainer* iContainer;    // Pointer of CCalcContainer class 
   383         CCalcAppEnv*    iCalcAppEnv;   // Not own
   402         CCalcAppEnv*    iCalcAppEnv;   // Not own
   384         RProperty       iQwertyModeStatusProperty; // To check the Qwerty keypad active 
   403         RProperty       iQwertyModeStatusProperty; // To check the Qwerty keypad active 
   385         
   404         
   386         TPtiTextCase	  iShiftKeyPressed;
   405         TPtiTextCase      iShiftKeyPressed;
   387         CPtiEngine*     iEngine;
   406         CPtiEngine*     iEngine;
   388         CRepository* 	  iCRKey;
   407         CRepository*       iCRKey;
   389         CPtiCoreLanguage* iCoreLanguage;
   408         CPtiCoreLanguage* iCoreLanguage;
   390         CPtiQwertyKeyMappings* iQwertyKeyMappings;
   409         CPtiQwertyKeyMappings* iQwertyKeyMappings;
   391 #ifdef RD_INTELLIGENT_TEXT_INPUT       
   410 #ifdef RD_INTELLIGENT_TEXT_INPUT       
   392         CPtiHalfQwertyKeyMappings* iHalfQwertyKeyMappings;
   411         CPtiHalfQwertyKeyMappings* iHalfQwertyKeyMappings;
   393 #endif
   412 #endif
   394 
   413 
   395         TInt 			      iLanguage;
   414         TInt                   iLanguage;
   396         TInt                  iUiLanguage;
   415         TInt                  iUiLanguage;
   397         TInt 			      iShiftKey;
   416         TInt                   iShiftKey;
   398         TBool 			    iValue;
   417         TBool                 iValue;
   399         TInt            iCountOfButtons;	//keeps track of the count of buttons
   418         TInt            iCountOfButtons;    //keeps track of the count of buttons
   400         TInt            iButtonsInRow;   //Number of buttons in the row
   419         TInt            iButtonsInRow;   //Number of buttons in the row
   401         TInt            iButtonsInColumn; //Number of buttons in the Column
   420         TInt            iButtonsInColumn; //Number of buttons in the Column
   402         TBool           iIsSqrtDimmed;  //Holds the state of the squareroot button
   421         TBool           iIsSqrtDimmed;  //Holds the state of the squareroot button
   403         TBool           iIsPercentDimmed;  //Holds the state of the percent button 
   422         TBool           iIsPercentDimmed;  //Holds the state of the percent button 
   404         TBool           iIsChangeSignDimmed; //Checks if the change sign button is dimmed or not
   423         TBool           iIsChangeSignDimmed; //Checks if the change sign button is dimmed or not
   405         TBool           iIsOfferKeyEvent; //checks if the event on select is from Offer key or pointer
   424         TBool           iIsOfferKeyEvent; //checks if the event on select is from Offer key or pointer
   406         TBool           iIsClearKeyEnabled;  //Checks if the Clear button is Enabled or not      
   425         TBool           iIsClearKeyEnabled;  //Checks if the Clear button is Enabled or not      
   407         TBool           iIsKeyLongPress;     //Checks if the button is Long Pressed or not
   426         TBool           iIsKeyLongPress;     //Checks if the button is Long Pressed or not
   408         TInt            iKeyboardType;
   427         TInt            iKeyboardType;
   409         TBool           iIsShiftKeyPressed;
   428         TBool           iIsShiftKeyPressed;
       
   429         TInt            iErrorCode;
       
   430         TBool           iShowDrawHight;
       
   431         TBool           iInputData;
   410     };
   432     };
   411 
   433 
   412 #endif      //  CALCFUNC_H
   434 #endif      //  CALCFUNC_H
   413             
   435             
   414 // End of File
   436 // End of File