emailuis/emailui/inc/ncsattachmentfield.h
changeset 0 8466d47a6819
child 2 5253a20d2a1e
equal deleted inserted replaced
-1:000000000000 0:8466d47a6819
       
     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:  Container class for compose view
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef CNCSATTACHMENTFIELD_H
       
    21 #define CNCSATTACHMENTFIELD_H
       
    22 
       
    23 
       
    24 #include "ncscontrol.h"
       
    25 
       
    26 
       
    27 class MNcsFieldSizeObserver;
       
    28 class CNcsHeaderContainer;
       
    29 
       
    30 
       
    31 /**
       
    32  *  CNcsAttachmentField
       
    33  */
       
    34 class CNcsAttachmentField: 
       
    35 	public CCoeControl,
       
    36 	public MNcsControl
       
    37     {
       
    38 public: // construct & destruct
       
    39 
       
    40     static CNcsAttachmentField* NewL( 
       
    41     	TInt aLabelTextId,
       
    42         MNcsFieldSizeObserver* aSizeObserver,
       
    43         CNcsHeaderContainer* aParentControl );
       
    44 
       
    45     virtual ~CNcsAttachmentField();
       
    46 
       
    47 public: // methods
       
    48 
       
    49     TInt MinimumHeight() const;
       
    50 
       
    51     void SetMaxLabelLength( TInt aMaxLength );
       
    52 
       
    53     TInt GetMinLabelLength() const;
       
    54     
       
    55     void SetTextL( const TDesC& aText );
       
    56     void SetTextL( const TDesC& aAttachmentName, const TDesC& aAttachmentSizeDesc );
       
    57 
       
    58 public: // from MNcsControl
       
    59     
       
    60     TInt LineCount() const;
       
    61 
       
    62     TInt ScrollableLines() const;
       
    63 
       
    64     TInt GetNumChars() const;
       
    65 
       
    66     TInt CursorLineNumber() const;
       
    67 
       
    68     TInt CursorPosition() const;
       
    69 
       
    70     void Reposition( TPoint& aPt, TInt aWidth );
       
    71 
       
    72     const TDesC& GetLabelText() const;
       
    73     
       
    74     // <cmail> Platform layout change       
       
    75     TInt LayoutLineCount() const;
       
    76     // </cmail> Platform layout change
       
    77     
       
    78 public: // from CCoeControl
       
    79 
       
    80     void Draw( const TRect& aRect ) const;
       
    81         
       
    82     void SizeChanged();
       
    83 
       
    84     void PositionChanged();
       
    85 
       
    86     void SetContainerWindowL( const CCoeControl& aContainer );
       
    87 
       
    88     void FocusChanged( TDrawNow aDrawNow );                  
       
    89 
       
    90     void HandleResourceChange( TInt aType );
       
    91 
       
    92 private: // methods
       
    93     
       
    94     CNcsAttachmentField( MNcsFieldSizeObserver* aSizeObserver, 
       
    95                          CNcsHeaderContainer* aParentControl );
       
    96         
       
    97     void ConstructL( TInt aLabelTextId );
       
    98     
       
    99     void UpdateColors();
       
   100     
       
   101 	void UpdateFontSize();
       
   102 
       
   103 	// <cmail> Platform layout change 
       
   104     void LayoutControls();
       
   105 	
       
   106 	void UpdateIconPositions( const TRect& aRect );
       
   107 	// </cmail> Platform layout change 
       
   108 
       
   109     void UpdateAttachmentTextL();
       
   110     
       
   111     // <cmail> Platform layout change
       
   112     /**
       
   113      * Resizes icons 
       
   114      */
       
   115     void ResizeIcons();
       
   116     
       
   117     TInt CreateIcons();
       
   118     void CreateIconsL();
       
   119     // </cmail> Platform layout change
       
   120     
       
   121 private: // data
       
   122     
       
   123     CNcsHeaderContainer* iParentControl; // not owned
       
   124     
       
   125     CNcsLabel* iAttachmentLabel;
       
   126     
       
   127 // <cmail> Platform layout change
       
   128     //CFont* iLabelFont; // not owned, needs to be released in the end
       
   129     //CFont* iEditorFont; // not owned, needs to be released in the end
       
   130     const CFont* iLabelFont; // not owned
       
   131     const CFont* iEditorFont; // not owned
       
   132 // </cmail>
       
   133     
       
   134     HBufC* iAttachmentName;
       
   135     HBufC* iAttachmentSizeDesc;
       
   136         
       
   137     TInt iMaximumLabelLength;         
       
   138 
       
   139     TRgb iBgColor;
       
   140     
       
   141     TRgb iBorderColor;
       
   142     
       
   143     // Attachment icon
       
   144     CFbsBitmap* iAttachmentBitmap;
       
   145     CFbsBitmap* iAttachmentMask;
       
   146     TPoint iAttachmentIconPos;
       
   147 
       
   148     // Action menu icon
       
   149     CFbsBitmap* iActionMenuBitmap;
       
   150     CFbsBitmap* iActionMenuMask;
       
   151     TPoint iActionMenuIconPos;
       
   152     };
       
   153 
       
   154 #endif