phoneuis/BubbleManager/Inc/BMBubbleOutlookNE.h
changeset 0 5f000ab63145
equal deleted inserted replaced
-1:000000000000 0:5f000ab63145
       
     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: 
       
    15 *     Handles number entry component
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 #ifndef BUBBLEOUTLOOKNE_H
       
    21 #define BUBBLEOUTLOOKNE_H
       
    22 
       
    23 // INCLUDES
       
    24 #include    <calslbs.h>
       
    25 #include    "BMBubbleOutlook.h"
       
    26 
       
    27 // FORWARD DECLARATIONS
       
    28 class CEikLabel; 
       
    29 class CEikImage;
       
    30 class CBubbleImageManager;
       
    31 class CBubbleHeader;
       
    32 class CAknPhoneNumberEditor;
       
    33 class CAknsBasicBackgroundControlContext;
       
    34 class CEikStatusPane;
       
    35 class CAknsFrameBackgroundControlContext;
       
    36 
       
    37 // CLASS DECLARATION
       
    38 
       
    39 /**
       
    40 *  CBubbleOutlookNumberEntry container class
       
    41 *
       
    42 *  Handles number entry component
       
    43 *
       
    44 *  @lib bubblemanager
       
    45 *  @since 1.0
       
    46 */
       
    47 class CBubbleOutlookNumberEntry : public CBubbleOutlook, 
       
    48                                   public MCoeControlObserver
       
    49     {
       
    50     public:
       
    51         
       
    52         // Place on the screen
       
    53         enum TPhoneNumberEntryPlace
       
    54             {
       
    55             ENENone,
       
    56             ENEBottom,         // NE + multiple calls
       
    57             ENEBottomRight,    // NE + single call
       
    58             ENEIdleState       // NE in idle state
       
    59             };
       
    60         
       
    61     public: // Constructors and destructor
       
    62         
       
    63         /**
       
    64         * Default constructor.
       
    65         * @param aBubbleManager Main container
       
    66         * @param aMutedImage Muted image pointer. This needs refresh when row
       
    67         *                    amount is changed.
       
    68         */
       
    69         CBubbleOutlookNumberEntry( CBubbleManager& aBubbleManager,
       
    70                                    const CCoeControl& aMutedImage );
       
    71 
       
    72         /**
       
    73         * Symbian OS 2nd phase constructor.
       
    74         */
       
    75         void ConstructL();
       
    76         
       
    77         /**
       
    78         * Destructor.
       
    79         */
       
    80         virtual ~CBubbleOutlookNumberEntry();
       
    81 
       
    82     public: // New functions
       
    83 
       
    84         /**
       
    85         * Set number entry in use.
       
    86         * @param aIsUsed ETrue if put to use.
       
    87         */
       
    88         void SetIsUsed( const TBool& aIsUsed );
       
    89 
       
    90         /**
       
    91         * Is number entry in use.
       
    92         * @return ETrue if in use.
       
    93         */
       
    94         TBool IsUsed() const;
       
    95 
       
    96         /**
       
    97         * Set number entry place.
       
    98         * @param aPlace Palce enumeration.
       
    99         */
       
   100         void SetPlace( const TPhoneNumberEntryPlace& aPlace );
       
   101 
       
   102         /**
       
   103         * Get number entry place
       
   104         * @return Place enumeration.
       
   105         */
       
   106         TPhoneNumberEntryPlace Place() const;
       
   107 
       
   108         /**
       
   109         * Get editor component.
       
   110         * @return The editor.
       
   111         */
       
   112         CCoeControl* GetEditor( ) const;
       
   113 
       
   114         /**
       
   115         * Set text in number entry.
       
   116         * @param aDesC Text to in.
       
   117         */
       
   118         void SetText( const TDesC& aDesC );
       
   119         
       
   120         /**
       
   121         * Get number entry text string.
       
   122         * @param aDesC Descriptor where the text is set to.
       
   123         */
       
   124         void GetText( TDes& aDesC ); 
       
   125         
       
   126         /**
       
   127         * Set number entry's editor mode.
       
   128         * @since 3.0
       
   129         * @param aMode for number editor input mode.
       
   130         * @return Input mode of the editor.
       
   131         */
       
   132         TInt ChangeEditorMode( TBool aDefaultMode = EFalse );
       
   133         
       
   134         /**
       
   135         * Get number entry's editor mode.
       
   136         * @since 3.0
       
   137         * @return Input mode of the editor.
       
   138         */
       
   139         TInt GetEditorMode() const;
       
   140         
       
   141         /**
       
   142         * Resets number entry editor to default values.
       
   143         * @since 3.0
       
   144         */
       
   145         void ResetEditorToDefaultValues();
       
   146         
       
   147     public: // Functions from base classes
       
   148         
       
   149         /**
       
   150         * From CBubbleOutlook
       
   151         */
       
   152         void Reset( );
       
   153         
       
   154         /**
       
   155         * From CBubbleOutlook
       
   156         */
       
   157         void ReadBubbleHeader( CBubbleHeader& aHeader );
       
   158         
       
   159         /**
       
   160         * From CBubbleOutlook
       
   161         */
       
   162         void DrawTimerCostNow();
       
   163         
       
   164         /**
       
   165         * From CBubbleOutlook
       
   166         */
       
   167         void DrawCLINow();
       
   168 
       
   169         /**
       
   170         * From CBubbleOutlook
       
   171         */
       
   172         void DrawBitmaps( CBitmapContext& aGc ) const;
       
   173 
       
   174         /**
       
   175         * From CBubbleOutlook.
       
   176         */
       
   177         virtual void HandleAnimationStartL() const;
       
   178 
       
   179         /**
       
   180         * From CBubbleOutlook.
       
   181         */
       
   182         virtual void ReleaseBitmaps();
       
   183 
       
   184         /**
       
   185         * From CBubbleOutlook.
       
   186         */
       
   187         virtual void RebuildBitmaps();
       
   188 
       
   189          /**
       
   190         * Update call header text and redraw it.
       
   191         */
       
   192         virtual void DrawCallHeaderText();
       
   193 
       
   194     private: // Functions from base classes
       
   195           
       
   196         /**
       
   197         * From CCoeControl
       
   198         */
       
   199         void SizeChanged();
       
   200         
       
   201         /**
       
   202         * From CCoeControl
       
   203         */
       
   204         TInt CountComponentControls() const;
       
   205         
       
   206         /**
       
   207         * From CCoeControl
       
   208         */
       
   209         CCoeControl* ComponentControl( TInt aIndex ) const;
       
   210         
       
   211         /**
       
   212         * From MCoeControlObserver
       
   213         */
       
   214         void HandleControlEventL( CCoeControl* aControl,TCoeEvent aEventType );
       
   215        
       
   216         /**
       
   217         * From CCoeControl
       
   218         */
       
   219         TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent, 
       
   220                                      TEventCode aType );
       
   221           
       
   222         /**
       
   223         * From CCoeControl
       
   224         */
       
   225         void FocusChanged( TDrawNow aDrawNow );
       
   226 
       
   227         /**
       
   228         * From CCoeControl
       
   229         */
       
   230         TTypeUid::Ptr MopSupplyObject( TTypeUid aId );
       
   231 
       
   232         /**
       
   233         * From CCoeControl
       
   234         */
       
   235         virtual void Draw( const TRect& aRect ) const;
       
   236 
       
   237     private: // New functions
       
   238 
       
   239         /**
       
   240         * Construct and layout the editor.
       
   241         * @param aReader a resource reader.
       
   242         * @since Series60_2.8
       
   243         * @return None.
       
   244         */
       
   245         void ConstructEditorFromResourceAndLayoutL( TResourceReader& aReader );
       
   246 
       
   247         /**
       
   248         * Get number entry rect.
       
   249         * @param aIndex a layout index.
       
   250         * @param aColor number entry text color value.
       
   251         * @return the rect of the number entry.
       
   252         * @since Series60_2.8
       
   253         */
       
   254         TRect NumberEntryRect( TInt aIndex, TRgb& aColor );
       
   255 
       
   256         /**
       
   257         * Update existing formats.
       
   258         */
       
   259         void UpdateEditorFormats( TPhoneNumberEntryPlace aPlace );
       
   260 
       
   261         /**
       
   262         * Update phone number editor skin color.
       
   263         */
       
   264         void UpdateEditorColor( const TRgb aColor );
       
   265         
       
   266         /**
       
   267         * SetPlace for 1-piece graphics
       
   268         */
       
   269         void SetPlace1( const TPhoneNumberEntryPlace& aPlace );
       
   270         
       
   271         /**
       
   272         * SetPlace for 9-piece graphics
       
   273         */
       
   274         void SetPlace2( const TPhoneNumberEntryPlace& aPlace );
       
   275         
       
   276         /**
       
   277         * SizeChanged for 1-piece graphics
       
   278         */
       
   279         void SizeChanged1();
       
   280         
       
   281         /**
       
   282         * SizeChanged for 9-piece graphics
       
   283         */
       
   284         void SizeChanged2();
       
   285              
       
   286         /**
       
   287          * Updates editor
       
   288          * 
       
   289          */
       
   290         void UpdateAndDrawEditor();
       
   291         
       
   292     private: //data
       
   293         
       
   294         // The editor component
       
   295         CAknPhoneNumberEditor* iEditor;
       
   296         
       
   297         // Muted image
       
   298         const CCoeControl& iMutedImage;
       
   299 
       
   300         // Current place
       
   301         TPhoneNumberEntryPlace iPlace;
       
   302         // Is NE used
       
   303         TBool iIsUsed;
       
   304         
       
   305         // Bubble graphics
       
   306         CEikImage* iBubble;
       
   307 
       
   308         // Last event
       
   309         TInt iLastEvent;
       
   310         // Was NE focused before
       
   311         TInt iWasFocused;
       
   312 
       
   313         // Skin control context for the editor (1-piece)
       
   314         CAknsBasicBackgroundControlContext* iSkinContext;
       
   315         
       
   316         // Skin control context for the editor (9-piece)
       
   317         CAknsFrameBackgroundControlContext* iFrameContext;
       
   318 
       
   319         // Amount of formats for updating.
       
   320         TInt iFormatCount;
       
   321 
       
   322         // Pointer to status pane.
       
   323         CEikStatusPane* iStatusPane; 
       
   324         
       
   325     };
       
   326 
       
   327 #endif // BUBBLEOUTLOOKNE_H
       
   328 
       
   329 // End of File