vtuis/videotelui/inc/CVtUiEndCallButton.h
branchRCL_3
changeset 12 f84a661cfc1d
equal deleted inserted replaced
8:07d1685f0cd4 12:f84a661cfc1d
       
     1 /*
       
     2 * Copyright (c) 2009 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:  End call button definition.
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef C_VTUIENDCALLBUTTON_H
       
    19 #define C_VTUIENDCALLBUTTON_H
       
    20 
       
    21 // INCLUDES
       
    22 #include    <aknbutton.h>
       
    23 #include    "videotelui.hrh"
       
    24 
       
    25 // CLASS DECLARATION
       
    26 
       
    27 /**
       
    28  *  CCVtUiEndCallButton
       
    29  * 
       
    30  */
       
    31 class CVtUiEndCallButton : public CAknButton
       
    32     {
       
    33 public:
       
    34     // Constructors and destructor
       
    35 
       
    36     /**
       
    37     * Static construction method.
       
    38     * @return Pointer to newly created instance of CVtUiEndCallButton.
       
    39     */
       
    40     static CVtUiEndCallButton* NewL();
       
    41     
       
    42     /**
       
    43     * C++ destructor.
       
    44     */
       
    45     ~CVtUiEndCallButton();
       
    46 
       
    47     /**
       
    48      * Constructs controls from a resource file.
       
    49      *
       
    50      * @param aReader The resource reader, with which to access the 
       
    51      *      control's resource values.
       
    52      */
       
    53     void ConstructFromResourceL( const TInt aResourceId );
       
    54     
       
    55     /**
       
    56     * The layout of text and the rectangle of icon setting method.
       
    57     * @param aLayoutText The text layout.
       
    58     * @param aIconRect The rectangle of icon to be set.
       
    59     */
       
    60     void SetLayout( const TAknLayoutText aLayoutText,
       
    61                     const TRect aIconRect);
       
    62     
       
    63 protected: 
       
    64     //from base class CCoeControl
       
    65     /**
       
    66      * From CCoeControl. 
       
    67      * Draws the control. Called by window server.
       
    68     */
       
    69     void Draw(const TRect& aRect) const;
       
    70     
       
    71     /**
       
    72      * Handles a change to the control's resources.
       
    73      *
       
    74      * @param aType is a message UID value.
       
    75      */
       
    76     void HandleResourceChange( TInt aType );
       
    77     
       
    78 private:
       
    79     
       
    80     /**
       
    81      * C++ constructor for the end call button.
       
    82      */
       
    83     CVtUiEndCallButton();
       
    84     
       
    85     /**
       
    86      * Symbian 2nd phase constructor.
       
    87      */
       
    88     void ConstructL();
       
    89     
       
    90     /**
       
    91      * Gets the correct text color.
       
    92      * 
       
    93      * @param aPenColor the RGB colour value
       
    94      */
       
    95     void GetTextColors( TRgb& aPenColor ) const;
       
    96     
       
    97     /**
       
    98      * Loads icons from the resource
       
    99      */
       
   100     void LoadButtonIcon( TVtUiBitmapId aIconId, TVtUiBitmapId aMaskId );
       
   101     
       
   102     /**
       
   103      * Draw text and icon according to the layout.
       
   104      * 
       
   105      * @param aGc the window graphics context
       
   106      */ 
       
   107     void LayoutIconAndText( CWindowGc& aGc ) const;
       
   108     
       
   109 private:
       
   110     
       
   111     /**
       
   112      * Layout text
       
   113      */
       
   114     TAknLayoutText iLayoutText;
       
   115     
       
   116     /**
       
   117      * Rectangle of the icon of the button.
       
   118      */
       
   119     TRect iIconRect;
       
   120     };
       
   121 
       
   122 #endif // C_VTUIENDCALLBUTTON_H