meetingrequest/mrgui/inc/cesmrview.h
changeset 0 8466d47a6819
child 16 4ce476e64c59
equal deleted inserted replaced
-1:000000000000 0:8466d47a6819
       
     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:  ESMR container for the title label and list component
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef CESMRVIEW_H
       
    19 #define CESMRVIEW_H
       
    20 
       
    21 #include <coecntrl.h>
       
    22 #include <eikmenup.h>
       
    23 
       
    24 #include "cesmrlistcomponent.h"
       
    25 #include "mesmrtitlepaneobserver.h"
       
    26 #include "mesmrfontsizeobserver.h"
       
    27 
       
    28 class CESMRTitlePane;
       
    29 class MESMRCalEntry;
       
    30 class MESMRFieldStorage;
       
    31 class MAgnEntryUiCallback;
       
    32 class CESMRLayoutManager;
       
    33 class CAknsBasicBackgroundControlContext;
       
    34 
       
    35 /**
       
    36  *  Container for the meeting request title and list control.
       
    37  * This class is deleted by framework
       
    38  */
       
    39 NONSHARABLE_CLASS( CESMRView ):
       
    40     public CCoeControl,
       
    41     public MCoeControlBackground,
       
    42     public MESMRFontSizeObserver,
       
    43     public MESMRTitlePaneObserver
       
    44     {
       
    45 public:
       
    46     /**
       
    47      * Two-phased constructor.
       
    48      *
       
    49      * @param aStorage - interface to storage that has all the fileds
       
    50      * @param aEntry - interface to entry information.
       
    51      * @param aRect - rect for this view
       
    52      * @return Pointer to created and initialized esmr view object.
       
    53      */
       
    54      static CESMRView* NewL( 
       
    55     		 MESMRFieldStorage* aStorage, 
       
    56     		 MESMRCalEntry& aEntry, 
       
    57     		 const TRect& aRect );
       
    58 
       
    59     /**
       
    60      * Destructor.
       
    61      */
       
    62     ~CESMRView();
       
    63 
       
    64 public:
       
    65 
       
    66     /**
       
    67     * Externalize the list component items. Data in list items
       
    68     * is stored to iEntry member variable.
       
    69     *
       
    70     * @param TBool ETrue if force validation should be used
       
    71     */
       
    72     void ExternalizeL( TBool aForceValidation = EFalse );
       
    73 
       
    74     /**
       
    75     * Internalize the list component items. Data from iEntry is updated
       
    76     * to all fields.
       
    77     */
       
    78     void InternalizeL();
       
    79 
       
    80     /**
       
    81     * Checks if the command can be processed
       
    82     * be handled by CESMRView.
       
    83     *
       
    84     * @param aCommand
       
    85     * @return ETrue if command can be processed
       
    86     */
       
    87     TBool CanProcessEditorCommandL( TInt aCommand );
       
    88 
       
    89     /**
       
    90     * Process commands. Dialog forwards the commands that must
       
    91     * be handled by CESMRView.
       
    92     *
       
    93     * @param aCommand
       
    94     */
       
    95     void ProcessEditorCommandL( TInt aCommand );
       
    96 
       
    97     /**
       
    98     * Query if a component with given id is currently visible
       
    99     *
       
   100     * @param aField Field Id which visibility we are interested in.
       
   101     * @return True if component is currently visible
       
   102     */
       
   103     TBool IsComponentVisible( TESMREntryFieldId aField ) const;
       
   104 
       
   105     /**
       
   106     * Title can be changed by calling this method
       
   107     *
       
   108     * @param aTitle New title for the view
       
   109     * @param aDefault
       
   110     */
       
   111     void SetTitleL( const TDesC& aTitle, TBool aDefault = EFalse );
       
   112 
       
   113     /**
       
   114     * Focused field in the list can be changed by calling this method
       
   115     *
       
   116     * @param aField Field id of the field that needs to be focused
       
   117     */
       
   118     void SetControlFocusedL( TESMREntryFieldId aField );
       
   119 
       
   120     /**
       
   121      * Launches editor help
       
   122      */
       
   123     void LaunchEditorHelpL();
       
   124 
       
   125     /**
       
   126      * Launches viewer help
       
   127      */
       
   128     void LaunchViewerHelpL();
       
   129     
       
   130     /**
       
   131 	* Query if a component with given id is currently focused
       
   132 	*
       
   133 	* @param aField Field Id which focus we are interested in.
       
   134 	* @return True if component is currently focused
       
   135 	*/
       
   136 	TBool IsComponentFocused( TESMREntryFieldId aField ) const;
       
   137 
       
   138 	/**
       
   139 	 * Returns the the currently focused field id. 
       
   140 	 */
       
   141 	TESMREntryFieldId FocusedField() const; 
       
   142 	
       
   143 public: // From CAknDialog
       
   144     void DynInitMenuPaneL( /*TInt aResourceId,*/ 
       
   145     		CEikMenuPane* aMenuPane );	
       
   146 
       
   147 public: // MESMRTitlePaneObserver
       
   148     void UpdateTitlePaneTextL( const TDesC& aText );
       
   149     void UpdateTitlePanePriorityIconL( TUint aPriority );
       
   150 
       
   151 private: // implementation
       
   152     void ConstructL( const TRect& aRect );
       
   153     CESMRView( MESMRFieldStorage* aStorage, MESMRCalEntry& aEntry );
       
   154 
       
   155 private:
       
   156     void LaunchHelpL( const TDesC& aContext );
       
   157 
       
   158 public: // From CCoeControl
       
   159     void SetContainerWindowL(const CCoeControl& aContainer);
       
   160     TInt CountComponentControls() const;
       
   161     CCoeControl* ComponentControl( TInt aInd ) const;
       
   162     void SizeChanged();
       
   163     TSize MinimumSize();
       
   164     TKeyResponse OfferKeyEventL(const TKeyEvent &aKeyEvent, TEventCode aType);
       
   165     void HandleResourceChange( TInt aType );
       
   166     TTypeUid::Ptr MopSupplyObject( TTypeUid aId );
       
   167 
       
   168     // <cmail>
       
   169     void FocusChanged(TDrawNow aDrawNow); 
       
   170     // </cmail>
       
   171 
       
   172 private: // From CCoeControl
       
   173     void Draw( const TRect& aRect ) const;
       
   174 
       
   175 protected: // FromMESMRFontSizeObserver
       
   176     void FontSizeSettingsChanged();
       
   177 
       
   178 public: // From MCoeControlBackground
       
   179     void Draw(CWindowGc& aGc, 
       
   180     		  const CCoeControl& aControl, 
       
   181     		  const TRect& aRect) const;
       
   182     void GetTextDrawer(
       
   183     		CCoeTextDrawerBase*& aText, 
       
   184     		const CCoeControl* aControl) const;
       
   185 
       
   186 private:
       
   187     /// Own: Priority icon
       
   188     CESMRTitlePane* iTitle;
       
   189     /// Own: Meeting Requst list component
       
   190     CESMRListComponent* iList;
       
   191     /// Ref: List item storage
       
   192     MESMRFieldStorage* iStorage;
       
   193     /// Ref: Current MR entry
       
   194     MESMRCalEntry& iEntry;
       
   195     /// Own: Pointer to layout manager
       
   196     CESMRLayoutManager* iLayout;
       
   197     /// Own: To enable skin as background for the iTitle   
       
   198     CAknsBasicBackgroundControlContext* iBgContext;
       
   199     };
       
   200 
       
   201 #endif //CESMRVIEW_H