meetingrequest/mrgui/mrfieldbuilderplugin/inc/cesmrsubjectfield.h
branchRCL_3
changeset 25 3533d4323edc
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 subject field implementation
       
    15  *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef CESMRSUBJECTFIELD_H
       
    20 #define CESMRSUBJECTFIELD_H
       
    21 
       
    22 #include <e32cmn.h>
       
    23 #include <eikedwob.h>
       
    24 #include <AknsControlContext.h>
       
    25 
       
    26 #include "cesmrfield.h"
       
    27 #include "nmrbitmapmanager.h"
       
    28 
       
    29 class CESMREditor;
       
    30 class MESMRTitlePaneObserver;
       
    31 class CMRImage;
       
    32 class CAknsBasicBackgroundControlContext;
       
    33 
       
    34 /**
       
    35  * This class is a custom field control that shows the subject of calendar events
       
    36  */
       
    37 NONSHARABLE_CLASS( CESMRSubjectField ) :
       
    38         public CESMRField,
       
    39         public MEikEdwinSizeObserver,
       
    40         public MEikEdwinObserver
       
    41     {
       
    42 public:
       
    43     enum TFieldType
       
    44         {
       
    45         ETypeSubject = 0,
       
    46         ETypeOccasion
       
    47         };
       
    48 
       
    49     /**
       
    50      * Creates new CESMRSubjectField object. Ownership
       
    51      * is transferred to caller.
       
    52      * @return Pointer to created object,
       
    53      */
       
    54     static CESMRSubjectField* NewL( TFieldType aType = ETypeSubject );
       
    55 
       
    56     /**
       
    57      * Destructor.
       
    58      */
       
    59     virtual ~CESMRSubjectField();
       
    60     
       
    61 public: // Interface
       
    62     void SetTitlePaneObserver( MESMRTitlePaneObserver* aObserver );
       
    63     
       
    64 protected: // From CESMRField
       
    65     TSize MinimumSize();
       
    66     void InitializeL();
       
    67     void InternalizeL( MESMRCalEntry& aEntry );
       
    68     void ExternalizeL( MESMRCalEntry& aEntry );
       
    69     void SetOutlineFocusL( TBool aFocus );    
       
    70     void GetCursorLineVerticalPos(TInt& aUpper, TInt& aLower);
       
    71     void ListObserverSet();
       
    72     TBool ExecuteGenericCommandL( TInt aCommand );
       
    73 
       
    74 protected: // From MEikEdwinSizeObserver
       
    75     TBool HandleEdwinSizeEventL( CEikEdwin* aEdwin, TEdwinSizeEvent aType, TSize aSize );
       
    76 
       
    77 protected: // From MEikEdwinObserver
       
    78     void HandleEdwinEventL(CEikEdwin* aEdwin,TEdwinEvent aEventType);
       
    79 
       
    80 protected: // From CCoeControl
       
    81     TInt CountComponentControls() const;
       
    82     CCoeControl* ComponentControl( TInt aInd ) const;
       
    83     void SizeChanged();
       
    84     void SetContainerWindowL( const CCoeControl& aContainer );
       
    85     TKeyResponse OfferKeyEventL( const TKeyEvent& aEvent, 
       
    86                                        TEventCode aType );
       
    87 
       
    88 private:
       
    89     /**
       
    90      * Constructor.
       
    91      */
       
    92     CESMRSubjectField();
       
    93 
       
    94     /**
       
    95      * Second phase constructor.
       
    96      *
       
    97      * @param aId field id
       
    98      * @param aTextId default text id
       
    99      * @param aIconID icon id
       
   100      */
       
   101     void ConstructL( 
       
   102             TESMREntryFieldId aId, 
       
   103             TInt aTextId, 
       
   104             NMRBitmapManager::TMRBitmapId aIconID );
       
   105     
       
   106     void SetPriorityIconL( TUint aPriority );
       
   107     
       
   108 private:
       
   109     // Not owned. Text editor.
       
   110     CESMREditor* iSubject;
       
   111     // Own: Field icon
       
   112     CMRImage* iFieldIcon;
       
   113     // Own: Priority icon
       
   114     CMRImage* iPriorityIcon;
       
   115     // Own: Edwin size
       
   116     TSize iSize;
       
   117     // Not owned
       
   118     MESMRTitlePaneObserver* iTitlePaneObserver;
       
   119     // Field editor line count
       
   120     TInt iLineCount;
       
   121     // Own: Background for the editor when it is focused
       
   122     CAknsBasicBackgroundControlContext* iBgControlContext;
       
   123     // Stores current priority value 
       
   124     TUint iCurrentPriority;
       
   125     };
       
   126 
       
   127 #endif  // CESMRSUBJECTFIELD_H
       
   128