meetingrequest/mrgui/inc/cesmrtrackingview.h
branchRCL_3
changeset 25 3533d4323edc
parent 12 4ce476e64c59
equal deleted inserted replaced
24:d189ee25cf9d 25:3533d4323edc
       
     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:  ESMR Tracking view container for the title label and list component
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef CESMRTRACKINGVIEW_H_
       
    19 #define CESMRTRACKINGVIEW_H_
       
    20 
       
    21 #include <coecntrl.h>
       
    22 #include <aknlists.h> 
       
    23 #include <eiklbo.h>
       
    24 
       
    25 #include "mesmrtitlepaneobserver.h"
       
    26 #include "mesmrfontsizeobserver.h"
       
    27 #include "tnavipaneclearer.h"
       
    28 
       
    29 #include "resmrstatic.h"
       
    30 #include "cesmrcontactmenuhandler.h"
       
    31 #include "nmrbitmapmanager.h"
       
    32 
       
    33 class CESMRTitlePane;
       
    34 class MESMRCalEntry;
       
    35 class MESMRFieldStorage;
       
    36 class MAgnEntryUiCallback;
       
    37 class CAknsBasicBackgroundControlContext;
       
    38 class CESMRTrackingViewDialog;
       
    39 
       
    40 /**
       
    41  *  Container for the meeting request title and list control.
       
    42  * This class is deleted by framework
       
    43  */
       
    44 NONSHARABLE_CLASS( CESMRTrackingView ):
       
    45     public CCoeControl,
       
    46     public MCoeControlBackground,
       
    47     public MESMRFontSizeObserver,
       
    48     public MEikListBoxObserver
       
    49     {
       
    50 public:
       
    51     /**
       
    52      * Two-phased constructor.
       
    53      *
       
    54      * @param aEntry - interface to entry information.
       
    55      * @param aRect - rect for this view
       
    56      * @param aReqAttendee - the count of required attendees
       
    57      * @param aOptAttendee - the count of optional attendees
       
    58      * @return Pointer to created and initialized esmr view object.
       
    59      */
       
    60      static CESMRTrackingView* NewL( 
       
    61              MESMRCalEntry& aEntry, 
       
    62              const TRect& aRect,
       
    63              const TInt &aReqAttendee,
       
    64              const TInt &aOptAttendee);
       
    65 
       
    66     /**
       
    67      * Destructor.
       
    68      */
       
    69     ~CESMRTrackingView();
       
    70 
       
    71 public:
       
    72 
       
    73     /**
       
    74     * Externalize the list component items. Data in list items
       
    75     * is stored to iEntry member variable.
       
    76     *
       
    77     * @param TBool ETrue if force validation should be used
       
    78     */
       
    79     void ExternalizeL( TBool aForceValidation = EFalse );
       
    80 
       
    81     /**
       
    82     * Internalize the list component items. Data from iEntry is updated
       
    83     * to all fields.
       
    84     */
       
    85     void InternalizeL();
       
    86 
       
    87     /**
       
    88     * Process commands. Dialog forwards the commands that must
       
    89     * be handled by CESMRTrackingView.
       
    90     *
       
    91     * @param aCommand
       
    92     */
       
    93     void ProcessEditorCommandL( TInt aCommand );
       
    94 
       
    95     /**
       
    96     * Title can be changed by calling this method
       
    97     *
       
    98     * @param aTitle New title for the view
       
    99     * @param aDefault
       
   100     */
       
   101     void SetTitleL( const TDesC& aTitle );
       
   102 
       
   103     /**
       
   104      * Launches editor help
       
   105      */
       
   106     void LaunchEditorHelpL();
       
   107 
       
   108     /**
       
   109      * Launches viewer help
       
   110      */
       
   111     void LaunchViewerHelpL();
       
   112 
       
   113     void SetParentDialog(CCoeControl* aParentDialog);
       
   114     
       
   115 private: // implementation
       
   116     void ConstructL( const TRect& aRect );
       
   117     CESMRTrackingView( MESMRCalEntry& aEntry, 
       
   118             const TInt &aReqAttendee,
       
   119             const TInt &aOptAttendee);
       
   120 
       
   121 private:
       
   122     // Define the type of icons for status type
       
   123     enum TStatusIconType
       
   124         {
       
   125         /** For accept */
       
   126         EAcceptIcon,
       
   127         /** For reject */
       
   128         ERejectIcon,
       
   129         /** For tentative */
       
   130         ETentativeIcon,
       
   131         /** For none status */
       
   132         ENoneIcon,
       
   133         /** For account total type number */
       
   134         ETotalIconNumber
       
   135         };
       
   136     void LaunchHelpL( const TDesC& aContext );
       
   137     void CreateTrackingListL();
       
   138     void InitTrackingListL();
       
   139     void InitStatusIconArrayL();
       
   140     CGulIcon* InitStatusIconL(NMRBitmapManager::TMRBitmapId aStatus);
       
   141 
       
   142 public: // From CCoeControl
       
   143     void SetContainerWindowL(const CCoeControl& aContainer);
       
   144     TInt CountComponentControls() const;
       
   145     CCoeControl* ComponentControl( TInt aInd ) const;
       
   146     void SizeChanged();
       
   147     TSize MinimumSize();
       
   148     TKeyResponse OfferKeyEventL(const TKeyEvent &aKeyEvent, TEventCode aType);
       
   149     void HandleResourceChange( TInt aType );
       
   150     TTypeUid::Ptr MopSupplyObject( TTypeUid aId );
       
   151 
       
   152 private: // From CCoeControl
       
   153     void Draw( const TRect& aRect ) const;
       
   154 
       
   155 protected: // FromMESMRFontSizeObserver
       
   156     void FontSizeSettingsChanged();
       
   157 
       
   158 public: // From MCoeControlBackground
       
   159     void Draw(CWindowGc& aGc, 
       
   160               const CCoeControl& aControl, 
       
   161               const TRect& aRect) const;
       
   162     void GetTextDrawer(
       
   163             CCoeTextDrawerBase*& aText, 
       
   164             const CCoeControl* aControl) const;
       
   165 
       
   166 public: // From MEikListBoxObserver
       
   167     virtual void HandleListBoxEventL(CEikListBox* aListBox, TListBoxEvent aEventType);    
       
   168     
       
   169 private:
       
   170     /// Own: Priority icon
       
   171     CESMRTitlePane* iTitle;
       
   172     /// Own: attendee list
       
   173     /// Own: The list for attendee names and tracking status
       
   174     CAknSingleGraphicStyleListBox* iList;
       
   175     /// Ref: List item storage
       
   176 //    MESMRFieldStorage* iStorage;
       
   177     /// Ref: Current MR entry
       
   178     MESMRCalEntry& iEntry;
       
   179     /// Own: To enable skin as background for the iTitle   
       
   180     CAknsBasicBackgroundControlContext* iBgContext;
       
   181     /// Own: This clears the navipane for us.
       
   182     TNavipaneClearer iClearer;
       
   183     /// Required attendee count
       
   184     TInt iReqAttendeeCount;
       
   185     /// Optional attendee count
       
   186     TInt iOptAttendeeCount;
       
   187     /// Own: list text array
       
   188     MDesCArray* iItemArray;
       
   189     /**
       
   190      * Static TLS stored variables.
       
   191      */
       
   192     RESMRStatic iESMRStatic;
       
   193     /**
       
   194      * Ref: Reference to menu handler
       
   195      */
       
   196     CESMRContactMenuHandler* iMenuHandler;
       
   197     /// Ref: Tracking View Dialog
       
   198     CESMRTrackingViewDialog* iParentDialog;
       
   199     /// Own: attendees' contact info
       
   200     TDesC* iAddress;
       
   201     /// Own: Focused list item index
       
   202     TInt iFocusedItemIndex;
       
   203     /// Own: Index of "Optional" item
       
   204     TInt iIndexOfOptLabel;
       
   205     };
       
   206 
       
   207 #endif /* CESMRTRACKINGVIEW_H_ */