emailuis/emailui/inc/ncsattachmentfield.h
branchRCL_3
changeset 80 726fba06891a
parent 64 3533d4323edc
equal deleted inserted replaced
73:c8382f7b54ef 80:726fba06891a
    25 
    25 
    26 
    26 
    27 class MNcsFieldSizeObserver;
    27 class MNcsFieldSizeObserver;
    28 class CNcsHeaderContainer;
    28 class CNcsHeaderContainer;
    29 
    29 
       
    30 /**
       
    31  * Interface for the attachment field observer
       
    32  */
       
    33 class MNcsAttachmentFieldObserver
       
    34     {
       
    35 public:
       
    36     /**
       
    37      * AttachmentOpenL
       
    38      * Informs observer that focused attachment should be opened
       
    39      */
       
    40     virtual void AttachmentOpenL() = 0;
       
    41 
       
    42     /**
       
    43      * AttachmentRemoveL
       
    44      * Informs observer that focused attachment should be removed
       
    45      */
       
    46     virtual void AttachmentRemoveL() = 0;
       
    47     };
       
    48 
    30 
    49 
    31 /**
    50 /**
    32  *  CNcsAttachmentField
    51  *  CNcsAttachmentField
    33  */
    52  */
    34 class CNcsAttachmentField: 
    53 class CNcsAttachmentField: 
    38 public: // construct & destruct
    57 public: // construct & destruct
    39 
    58 
    40     static CNcsAttachmentField* NewL( 
    59     static CNcsAttachmentField* NewL( 
    41     	TInt aLabelTextId,
    60     	TInt aLabelTextId,
    42         MNcsFieldSizeObserver* aSizeObserver,
    61         MNcsFieldSizeObserver* aSizeObserver,
       
    62         MNcsAttachmentFieldObserver* aObserver,
    43         CNcsHeaderContainer* aParentControl );
    63         CNcsHeaderContainer* aParentControl );
    44 
    64 
    45     virtual ~CNcsAttachmentField();
    65     virtual ~CNcsAttachmentField();
    46 
    66 
    47 public: // methods
    67 public: // methods
    53     TInt GetMinLabelLength() const;
    73     TInt GetMinLabelLength() const;
    54     
    74     
    55     void SetTextsLD( CDesCArray* aAttachmentNames, 
    75     void SetTextsLD( CDesCArray* aAttachmentNames, 
    56                      CDesCArray* aAttachmentSizes );
    76                      CDesCArray* aAttachmentSizes );
    57 
    77 
    58     TInt FocusedAttachmentLabelIndex();
    78     TInt FocusedAttachmentLabelIndex() const;
    59   
    79 
       
    80     void SetFocusedAttachmentLabelIndex( TInt aIndex );
       
    81 
    60 public: // from MNcsControl
    82 public: // from MNcsControl
    61     
    83     
    62     TInt LineCount() const;
    84     TInt LineCount() const;
    63 
    85 
    64     TInt ScrollableLines() const;
    86     TInt ScrollableLines() const;
    83 
   105 
    84     void PositionChanged();
   106     void PositionChanged();
    85 
   107 
    86     void SetContainerWindowL( const CCoeControl& aContainer );
   108     void SetContainerWindowL( const CCoeControl& aContainer );
    87 
   109 
    88     void FocusChanged( TDrawNow aDrawNow );                  
   110     void FocusChanged( TDrawNow aDrawNow );
    89 
   111 
    90     void HandleResourceChange( TInt aType );
   112     void HandleResourceChange( TInt aType );
    91 
   113 
    92     void HandlePointerEventL( const TPointerEvent& aPointerEvent );
   114     void HandlePointerEventL( const TPointerEvent& aPointerEvent );
    93     
   115 
       
   116     TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent,TEventCode aType );
       
   117 
    94 private: // methods
   118 private: // methods
    95     
   119 
    96     CNcsAttachmentField( TInt aLabelTextId,
   120     CNcsAttachmentField( TInt aLabelTextId,
    97                          MNcsFieldSizeObserver* aSizeObserver, 
   121                          MNcsFieldSizeObserver* aSizeObserver, 
       
   122                          MNcsAttachmentFieldObserver* aObserver,
    98                          CNcsHeaderContainer* aParentControl );
   123                          CNcsHeaderContainer* aParentControl );
    99         
   124 
   100     void ConstructL();
   125     void ConstructL();
   101     
   126     
   102     void UpdateColors();
   127     void UpdateColors();
   103     void UpdateColors( CNcsLabel* aLabel );
   128     void UpdateColors( CNcsLabel* aLabel );
   104     
   129     
   122     void UpdateComponentArrayL();
   147     void UpdateComponentArrayL();
   123     
   148     
   124     void UpdateSingleAttachmentLabelTextL( CNcsLabel* aLabel, TInt aIndex );
   149     void UpdateSingleAttachmentLabelTextL( CNcsLabel* aLabel, TInt aIndex );
   125     
   150     
   126 private: // data
   151 private: // data
   127     
   152 
   128     CNcsHeaderContainer* iParentControl; // not owned
   153     CNcsHeaderContainer* iParentControl; // not owned
   129     
   154 
       
   155     // attachment field observer
       
   156     MNcsAttachmentFieldObserver* iObserver;
       
   157 
   130     // attachment labels (within the array) owned
   158     // attachment labels (within the array) owned
   131     RPointerArray<CNcsLabel> iAttachmentLabels;
   159     RPointerArray<CNcsLabel> iAttachmentLabels;
   132     
   160     
   133     const CFont* iLabelFont; // not owned
   161     const CFont* iLabelFont; // not owned
   134     const CFont* iEditorFont; // not owned
   162     const CFont* iEditorFont; // not owned