phoneuis/dialer/inc/cdialer.h
branchRCL_3
changeset 9 8871b09be73b
parent 0 5f000ab63145
child 17 38529f706030
equal deleted inserted replaced
4:c84cf270c54f 9:8871b09be73b
     1 /*
     1 /*
     2 * Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
     2 * Copyright (c) 2007 - 2010 Nokia Corporation and/or its subsidiary(-ies). 
     3 * All rights reserved.
     3 * All rights reserved.
     4 * This component and the accompanying materials are made available
     4 * This component and the accompanying materials are made available
     5 * under the terms of "Eclipse Public License v1.0"
     5 * under the terms of "Eclipse Public License v1.0"
     6 * which accompanies this distribution, and is available
     6 * which accompanies this distribution, and is available
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
    35 class MNumberEntry;
    35 class MNumberEntry;
    36 class CEikMenuPane;
    36 class CEikMenuPane;
    37 class CEikonEnv;
    37 class CEikonEnv;
    38 class CAknEdwinState;
    38 class CAknEdwinState;
    39 class MNumberEntryObserver;
    39 class MNumberEntryObserver;
       
    40 class CDialingExtensionInterface;
       
    41 class CDialingExtensionObserver;
       
    42 class CDialerToolbarContainer;
       
    43 class MPhoneDialerController;
    40 
    44 
    41 // CLASS DECLARATION
    45 // CLASS DECLARATION
    42 
    46 
    43 /**
    47 /**
    44 *  CDialer class.
    48 *  CDialer class.
   112     iDialer->RemoveNumberEntry( );
   116     iDialer->RemoveNumberEntry( );
   113     // Delete dialer
   117     // Delete dialer
   114     delete dialer;
   118     delete dialer;
   115 *
   119 *
   116 */
   120 */
   117 NONSHARABLE_CLASS(CDialer) : public CCoeControl, public MNumberEntry
   121 NONSHARABLE_CLASS(CDialer) : public CCoeControl, public MNumberEntry, public MCoeControlObserver // easy dialing change
   118     {
   122     {
   119     public:  // Constructors and destructor
   123     public:  // Constructors and destructor
   120 
   124 
   121         /**
   125         /**
   122         * Two phase constructor
   126         * Two phase constructor
   123         * @param aContainer Parent container
   127         * @param aContainer Parent container
   124         * @param aRect Area to use for dialer
   128         * @param aRect Area to use for dialer
       
   129         * @param aController Dialer controller providing state data for dialer
   125         * @return New instance of Dialer
   130         * @return New instance of Dialer
   126         */
   131         */
   127         IMPORT_C static CDialer* NewL( const CCoeControl& aContainer,
   132         IMPORT_C static CDialer* NewL( const CCoeControl& aContainer,
   128                                        const TRect& aRect );
   133                                        const TRect& aRect,
       
   134                                        MPhoneDialerController* aController );
   129 
   135 
   130         /**
   136         /**
   131         * Destructor.
   137         * Destructor.
   132         */
   138         */
   133         IMPORT_C virtual ~CDialer();
   139         IMPORT_C virtual ~CDialer();
   142 
   148 
   143         /**
   149         /**
   144         * Set number entry observer.
   150         * Set number entry observer.
   145         */
   151         */
   146         IMPORT_C void SetNumberEntryObserver( MNumberEntryObserver& aObserver );
   152         IMPORT_C void SetNumberEntryObserver( MNumberEntryObserver& aObserver );
       
   153 
       
   154         /**
       
   155         * Sets controller of the dialer. Controller is responsible of providing
       
   156         * toolbar functions, text prompt, etc, as appropriate for the curret dialer state.
       
   157         */
       
   158         IMPORT_C void SetControllerL( MPhoneDialerController* aController );
       
   159 
       
   160         /**
       
   161         * Gets current controller of the dialer.
       
   162         */
       
   163         IMPORT_C MPhoneDialerController* Controller();
       
   164         
       
   165         /**
       
   166          * Returns pointer to easydialing interface. This can be NULL if
       
   167          * easydialing is not present in device, so value must be checked
       
   168          * before using the interface.
       
   169          * 
       
   170          * @return  Pointer to easydialing interface
       
   171          */
       
   172         IMPORT_C CDialingExtensionInterface* GetEasyDialingInterface() const;
       
   173         
       
   174         /**
       
   175          * Toolbar of the easydialing layout is owned by the Dialer.
       
   176          * Calling this methods updates status of its buttons.
       
   177          */
       
   178         IMPORT_C void UpdateToolbar();
   147         
   179         
   148     public: // from MNumberEntry 
   180     public: // from MNumberEntry 
   149 
   181 
   150         /**
   182         /**
   151         * Sets number entry active.
   183         * Sets number entry active.
   177         */
   209         */
   178         void SetTextToNumberEntry( const TDesC& aDesC );
   210         void SetTextToNumberEntry( const TDesC& aDesC );
   179         
   211         
   180         /**
   212         /**
   181         * Get Number Entry Text.
   213         * Get Number Entry Text.
   182         * @param aDesC The text.
   214         * @param aDes The text.
   183         */
   215         */
   184         void GetTextFromNumberEntry( TDes& aDesC );
   216         void GetTextFromNumberEntry( TDes& aDes );
   185         
   217         
   186         /**
   218         /**
   187         * Removes NE and empties the buffer.
   219         * Removes NE and empties the buffer.
   188         */
   220         */
   189         void RemoveNumberEntry( );
   221         void RemoveNumberEntry( );
   221         * Enable or disable tactile feedback. 
   253         * Enable or disable tactile feedback. 
   222         * @param aEnable.
   254         * @param aEnable.
   223         */             
   255         */             
   224         void EnableTactileFeedback( const TBool aEnable );
   256         void EnableTactileFeedback( const TBool aEnable );
   225 
   257 
       
   258     private: // Functions from MCoeControlObserver
       
   259         
       
   260         void HandleControlEventL( CCoeControl* aControl, TCoeEvent aEventType );
       
   261         
   226     private:  // Functions from CCoeControl
   262     private:  // Functions from CCoeControl
   227         
   263         
   228         /**
   264         /**
   229         * @see CCoeControl
   265         * @see CCoeControl
   230         */
   266         */
   285 
   321 
   286         /**
   322         /**
   287         * 2nd phase constructor.
   323         * 2nd phase constructor.
   288         * @param aContainer Parent container
   324         * @param aContainer Parent container
   289         * @param aRect Area to use for dialer
   325         * @param aRect Area to use for dialer
   290         */
   326         * @param aController Dialer controller providing state data for dialer 
   291         void ConstructL( const CCoeControl& aContainer , 
   327         */
   292             const TRect& aRect );
   328         void ConstructL( const CCoeControl& aContainer, 
       
   329             const TRect& aRect,
       
   330             MPhoneDialerController* aController );
   293         
   331         
   294         /**
   332         /**
   295         * Load resource file.
   333         * Load resource file.
   296         */
   334         */
   297         void LoadResourceL();
   335         void LoadResourceL();
   317          * Updates editor flags for virtual
   355          * Updates editor flags for virtual
   318          * keyboard.
   356          * keyboard.
   319          */
   357          */
   320         void UpdateVkbEditorFlagsL();
   358         void UpdateVkbEditorFlagsL();
   321 
   359 
       
   360         /**
       
   361          * Loads easydialing plugin. If loading fails (for instance when
       
   362          * easydialing feature flag is not enabled in the device),
       
   363          * iEasyDialer will be NULL after this function returns.
       
   364          */
       
   365         void LoadEasyDialingPlugin();
       
   366         
       
   367         /**
       
   368          * Checks if Easy dialing is available, allowed, and currently enabled.
       
   369          * 
       
   370          * @return  ETrue if Easy Dialing is enabked 
       
   371          */
       
   372         TBool EasyDialingEnabled() const;
       
   373         
       
   374         /**
       
   375          * Layout number entry component. The used layout depends on
       
   376          * the availability and state of Easy dialing. 
       
   377          */
       
   378         void LayoutNumberEntry( const TRect& aParent, TInt aVariety );
       
   379         
   322     private:    // Data
   380     private:    // Data
   323           
   381           
   324         // Keypad container  - owned
   382         // Keypad container  - owned
   325         CDialerKeyPadContainer* iKeypadArea;
   383         CDialerKeyPadContainer* iKeypadArea;
   326              
   384              
   327         // Number entry container - owned
   385         // Number entry container - owned
   328         CDialerNumberEntry* iNumberEntry;
   386         CDialerNumberEntry* iNumberEntry;
   329         
   387         
   330         // Parent container
       
   331         const CCoeControl* iParentControl;
       
   332         
       
   333         // Is Number entry (e.g. dialer) being used at the moment
   388         // Is Number entry (e.g. dialer) being used at the moment
   334         TBool iIsUsed;
   389         TBool iIsUsed;
   335         
   390         
   336         // Reference to CEikonEnv
   391         // Reference to CEikonEnv
   337         CEikonEnv& iEikEnv;
   392         CEikonEnv& iEikEnv;
   340         TInt iResourceOffset;
   395         TInt iResourceOffset;
   341         
   396         
   342         // Is virtual key board open
   397         // Is virtual key board open
   343         TBool iVirtualKeyBoardOpen;
   398         TBool iVirtualKeyBoardOpen;
   344 
   399 
       
   400         /**
       
   401          * Easydialing plugin. This can be NULL if easydialing feature flag
       
   402          * is not enabled in the device.
       
   403          * Own.
       
   404          */
       
   405         CDialingExtensionInterface* iEasyDialer;
       
   406         
       
   407         /**
       
   408          * Observer for Easydialing.
       
   409          * Own.
       
   410          */
       
   411         CDialingExtensionObserver* iDialingExtensionObserver;
       
   412         
       
   413         /**
       
   414          * Toolbar used in Easy dialing layout.
       
   415          * Own.
       
   416          */
       
   417         CDialerToolbarContainer* iToolbar;
       
   418         
       
   419         /**
       
   420          * Controller rules the mode of the Dialer (e.g. normal, DTMF, restricted...)
       
   421          * Not owned.
       
   422          */
       
   423         MPhoneDialerController* iController;
   345     };
   424     };
   346 
   425 
   347 #endif      // CDIALER_H
   426 #endif      // CDIALER_H
   348 
   427 
   349 // End of File
   428 // End of File