phoneapp/phoneuiview/inc/cphonenumberentry.h
changeset 0 5f000ab63145
equal deleted inserted replaced
-1:000000000000 0:5f000ab63145
       
     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: Definition of number entry handler.
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef CPHONENUMBERENTRY_H
       
    19 #define CPHONENUMBERENTRY_H
       
    20 
       
    21 // Includes
       
    22 #include <e32base.h>
       
    23 
       
    24 #include "mphonenumberentry.h"
       
    25 #include "mphonenumberentrychangedhandler.h"
       
    26 
       
    27 // Forward declarations
       
    28 class CBubbleManager;
       
    29 class MNumberEntry;
       
    30 class CCoeControl;
       
    31 class TPhoneCommandParam;
       
    32 
       
    33 /**
       
    34  *  Access to number entry.
       
    35  *
       
    36  *  @lib PhoneUIView.lib
       
    37  *  @since S60 v5.0
       
    38  */
       
    39 NONSHARABLE_CLASS( CPhoneNumberEntry ): public CBase, public MPhoneNumberEntry,
       
    40     public MPhoneNumberEntryChangedHandler
       
    41     {
       
    42 
       
    43 public:
       
    44 
       
    45 
       
    46     static CPhoneNumberEntry* NewL( CBubbleManager& aBubbleManager );
       
    47 
       
    48     virtual ~CPhoneNumberEntry();
       
    49     
       
    50     // From MPhoneNumberEntry
       
    51     
       
    52     void EnableTactileFeedback( const TBool aEnable );
       
    53     
       
    54     TBool IsNumberEntryUsed() const;
       
    55     
       
    56     TInt CountNumberEntryCharacters();
       
    57     
       
    58     void SetNumberEntry( MNumberEntry* aNumberEntry );
       
    59     
       
    60     void SetNumberEntryContent( const TDesC& aContent );
       
    61     
       
    62     void SetNumberEntryPromptText( const TDesC& aPromptText ); 
       
    63     
       
    64     // from base class MPhoneNumberEntryChangedHandler
       
    65     
       
    66     /**
       
    67      * From MPhoneNumberEntryChangedHandler
       
    68      * 
       
    69      * Handles number entry state change. 
       
    70      * Checks has the content of the number entry been modifed.
       
    71      * Informs the via call back functionality the party interested about 
       
    72      * the change. (at the moment phone state machine) 
       
    73      * 
       
    74      * @since S60 5.0
       
    75      */
       
    76     void HandleNumberEntryChanged( );
       
    77     
       
    78     /**
       
    79      * From MPhoneNumberEntryChangedHandler
       
    80      * 
       
    81      * Sets the call back function that is used to get notification when the 
       
    82      * content of the Number Entry has changed. (Used by the the phone 
       
    83      * statemachine.)  
       
    84      * 
       
    85      * @since S60 5.0
       
    86      */
       
    87     void SetNumberEntryChangedCallBack( TPhoneCommandParam* aCommandParam );
       
    88    
       
    89 private:
       
    90 
       
    91     CPhoneNumberEntry( CBubbleManager& aBubbleManager );
       
    92     
       
    93     void ConstructL();
       
    94     
       
    95     /**
       
    96      * Compares previous number entry content to current.
       
    97      * If it is different updates the previous buffer. 
       
    98      * 
       
    99      * @return ETrue if nubmer entry content has changed
       
   100      */
       
   101     TBool CheckNumberEntryContent();
       
   102     
       
   103     /**
       
   104      * Updates the previous number entry buffer. 
       
   105      * 
       
   106      * @return ETrue if nubmer entry content was changed
       
   107      */
       
   108     TBool UpdatePreviousNumberEntryContent( CCoeControl* aEditor );
       
   109     
       
   110     /**
       
   111      * Returns pointer to phonenumbereditor of the Dialer number entry , 
       
   112      * if it in use
       
   113      * 
       
   114      * @return pointer to number entry editor
       
   115      */
       
   116     CCoeControl* DialerNumberEntryEditor() const;
       
   117     
       
   118     /**
       
   119      * Returns pointer to phonenumbereditor of the Bubblemanager number entry , 
       
   120      * if it in use
       
   121      * 
       
   122      * @return pointer to number entry editor
       
   123      */
       
   124     CCoeControl* BubbleNumberEntryEditor() const;
       
   125 
       
   126 private:
       
   127     
       
   128     CBubbleManager& iBubbleManager;
       
   129     
       
   130     /**
       
   131      * Pointer to MNumberEntry, dialercontroller sets this to 
       
   132      * point to touch dialer.
       
   133      * Not own.
       
   134      */
       
   135     MNumberEntry* iDialerNumberEntry;
       
   136     
       
   137     // Owned contents.
       
   138     HBufC* iNumberEntryContents;
       
   139     
       
   140     /**
       
   141      * Is used to check is touch dialer enabled.
       
   142      */
       
   143     TBool iUseDialer;
       
   144     
       
   145     /*
       
   146     * Call back function to inform that the content of 
       
   147     * Number Entry has changed.
       
   148     */
       
   149     TCallBack iNEChangedCallBack;
       
   150     
       
   151     /**
       
   152      * Keeps track of the content of the number entry
       
   153      * Own.
       
   154      */
       
   155     HBufC* iPreviousNumberEntryContent;     
       
   156     
       
   157     };
       
   158 
       
   159 
       
   160 #endif // CPHONENUMBERENTRY_H