messagingappbase/msgeditor/viewinc/MsgHeader.h
changeset 0 72b543305e3a
equal deleted inserted replaced
-1:000000000000 0:72b543305e3a
       
     1 /*
       
     2 * Copyright (c) 2002-2006 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:  MsgHeader  declaration
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef CMSGHEADER_H
       
    21 #define CMSGHEADER_H
       
    22 
       
    23 // ========== INCLUDE FILES ================================
       
    24 
       
    25 #include "MsgFormComponent.h"              // for CMsgFormComponent
       
    26 
       
    27 // ========== CONSTANTS ====================================
       
    28 
       
    29 // ========== MACROS =======================================
       
    30 
       
    31 // ========== DATA TYPES ===================================
       
    32 
       
    33 // ========== FUNCTION PROTOTYPES ==========================
       
    34 
       
    35 // ========== FORWARD DECLARATIONS =========================
       
    36 
       
    37 class CMsgCaptionedHighlight;
       
    38 class CMsgDummyHeaderCleaner;
       
    39 
       
    40 // ========== CLASS DECLARATION ============================
       
    41 
       
    42 /**
       
    43 * Defines header control container for message editors/viewers.
       
    44 *
       
    45 */
       
    46 class CMsgHeader : public CMsgFormComponent,
       
    47                    public MCoeControlHitTest
       
    48     {
       
    49     public:
       
    50 
       
    51         /**
       
    52         * Factory method that creates this control.
       
    53         * @param aParent
       
    54         * @param aMargins
       
    55         * @return
       
    56         */
       
    57         static CMsgHeader* NewL( const CCoeControl& aParent, 
       
    58                                  const TMargins& aMargins);
       
    59 
       
    60         /**
       
    61         * Destructor.
       
    62         */
       
    63         virtual ~CMsgHeader();
       
    64 
       
    65     public:  // Methods from base classes
       
    66 
       
    67         /**
       
    68         * Calculates and sets the size for the header and returns new size as
       
    69         * reference aSize. If aInit == ETrue, sets also size for the controls
       
    70         * by calling their SetAndGetSizeL functions.
       
    71         *
       
    72         * @param aSize
       
    73         * @param aInit
       
    74         */
       
    75         void SetAndGetSizeL( TSize& aSize, TBool aInit );    
       
    76 
       
    77         /**
       
    78         * Draws the header.
       
    79         * @param aRect
       
    80         */
       
    81         void Draw( const TRect& aRect ) const;
       
    82 
       
    83         /**
       
    84         * Returns a number of controls.
       
    85         * @return
       
    86         */
       
    87         TInt CountComponentControls() const;
       
    88 
       
    89         /**
       
    90         * Returns a control of index aIndex.
       
    91         * @param aIndex
       
    92         * @return
       
    93         */
       
    94         CCoeControl* ComponentControl( TInt aIndex ) const;    
       
    95         
       
    96         /**
       
    97         * Evaluates whether control is "hit" by touch event.
       
    98         */
       
    99         TBool HitRegionContains( const TPoint& aPoint, const CCoeControl& aControl ) const;
       
   100 
       
   101     protected:  // from CCoeControl
       
   102 
       
   103         /**
       
   104         * Sets new position for all the controls.
       
   105         */
       
   106         void SizeChanged();
       
   107 
       
   108         /**
       
   109         * This is called when the focus of the control is changed.
       
   110         * @param aDrawNow
       
   111         */
       
   112         void FocusChanged( TDrawNow aDrawNow );
       
   113 
       
   114     private:
       
   115         
       
   116         /**
       
   117         * Constructor (not available).
       
   118         */
       
   119         CMsgHeader();
       
   120         
       
   121         /**
       
   122         * Constructor.
       
   123         * @param aMargins
       
   124         */
       
   125         CMsgHeader( const TMargins& aMargins );
       
   126 
       
   127         /**
       
   128         * 2nd phase constructor.
       
   129         * @param aParent
       
   130         */
       
   131         void ConstructL( const CCoeControl& aParent );
       
   132 
       
   133     private:
       
   134 
       
   135         CMsgCaptionedHighlight* iFrame;
       
   136         CMsgDummyHeaderCleaner* iHeaderCleaner;
       
   137     };
       
   138 
       
   139 #endif // CMSGHEADER_H
       
   140 
       
   141 // End of File