meetingrequest/mrgui/mrfieldbuilderpluginextension/inc/cesmrviewerattachmentsfield.h
branchRCL_3
changeset 12 4ce476e64c59
parent 11 0396474f30f5
child 13 8592a65ad3fb
equal deleted inserted replaced
11:0396474f30f5 12:4ce476e64c59
     1 /*
       
     2 * Copyright (c) 2007-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:  Meeting request attachments field
       
    15  *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef CESMRVIEWERATTACHMENTSFIELD_H
       
    20 #define CESMRVIEWERATTACHMENTSFIELD_H
       
    21 
       
    22 #include <eikedwob.h>
       
    23 
       
    24 #include "cesmrfield.h"
       
    25 #include "cesmrrichtextviewer.h"
       
    26 #include "resmrstatic.h"
       
    27 
       
    28 class CESMRRichTextViewer;
       
    29 class CESMRRichTextLink;
       
    30 class CMRImage;
       
    31 
       
    32 // <cmail>
       
    33 class CESMRAttachmentInfo;
       
    34 class CFSMailMessage;
       
    35 // </cmail>
       
    36 
       
    37 /**
       
    38  * Shows the attachments
       
    39  **/
       
    40 NONSHARABLE_CLASS( CESMRViewerAttachmentsField ):
       
    41     public CESMRField,
       
    42     public MEikEdwinSizeObserver,
       
    43     public MESMRRichTextObserver,
       
    44     public MEikCommandObserver
       
    45     {
       
    46 public:
       
    47     /**
       
    48      * Constructor for attachments field
       
    49      *
       
    50      * @return New attachments field object
       
    51      */
       
    52     static CESMRViewerAttachmentsField* NewL( );
       
    53     
       
    54     /**
       
    55      * C++ Destructor.
       
    56      */
       
    57     ~CESMRViewerAttachmentsField( );
       
    58 
       
    59 public: // From CESMRField
       
    60     TSize MinimumSize();
       
    61     void InternalizeL( MESMRCalEntry& aEntry );
       
    62     void InitializeL();
       
    63     void ListObserverSet();
       
    64     void SetOutlineFocusL( TBool aFocus );
       
    65     void ExecuteGenericCommandL( TInt aCommand );
       
    66 
       
    67 public: // From MESMRRichTextObserver
       
    68     TBool HandleRichTextLinkSelection(const CESMRRichTextLink* aLink );
       
    69 
       
    70 public: // From CCoeControl
       
    71     TKeyResponse OfferKeyEventL(const TKeyEvent& aEvent, TEventCode aType );
       
    72     TInt CountComponentControls() const;
       
    73     CCoeControl* ComponentControl( TInt aInd ) const;
       
    74     void SizeChanged();
       
    75     void SetContainerWindowL( const CCoeControl& aContainer );
       
    76 
       
    77 public: // From MEikEdwinSizeObserver
       
    78     TBool HandleEdwinSizeEventL( CEikEdwin* aEdwin, TEdwinSizeEvent aType,
       
    79             TSize aSize );
       
    80 
       
    81 protected: // From MEikCommandObserver
       
    82     
       
    83     /**
       
    84      * Process commands from contact menu handler.
       
    85      * Forwards commands to event observer. 
       
    86      */
       
    87     void ProcessCommandL( TInt aCommandId );
       
    88     
       
    89 private: // Implementation
       
    90     CESMRViewerAttachmentsField();
       
    91     void ConstructL();
       
    92     TRect RichTextViewerRect();
       
    93     
       
    94     // <cmail>
       
    95     /**
       
    96      * Cleanup operations for RPointerArray.
       
    97      *
       
    98      * @param aArray Pointer to RPointerArray.
       
    99      */
       
   100     static void MessagePartPointerArrayCleanup( TAny* aArray );
       
   101 
       
   102     void UpdateAttachmentInfoL();
       
   103     // </cmail>
       
   104 
       
   105 private:
       
   106     // Size of this field
       
   107     TSize iSize;
       
   108     // Own: Field icon
       
   109     CMRImage* iFieldIcon;
       
   110     // Actual text of this field
       
   111     CESMRRichTextViewer* iRichTextViewer;
       
   112     // RichTextViewer line count. Own
       
   113     TInt iLineCount;
       
   114     // <cmail>
       
   115     /// Own:
       
   116     RESMRStatic iESMRStatic;
       
   117     /// Ref: Contact Menu handler
       
   118     CESMRContactMenuHandler* iCntMenuHdlr;
       
   119     // </cmail>
       
   120     // The number of attached files.
       
   121     TInt iAttachmentCount;
       
   122     // The attachment text
       
   123     HBufC* iAttachmentText;
       
   124     // <cmail>
       
   125     CFSMailMessage* iMailMessage;   // ref
       
   126     CESMRAttachmentInfo* iAttachmentInfo;   // own
       
   127     
       
   128     TBool iFocused;
       
   129     // </cmail>
       
   130     };
       
   131 
       
   132 #endif