meetingrequest/mrgui/mrfieldbuilderplugin/inc/cesmrsubjectfield.h
branchRCL_3
changeset 12 4ce476e64c59
parent 0 8466d47a6819
child 16 b5fbb9b25d57
equal deleted inserted replaced
11:0396474f30f5 12:4ce476e64c59
     1 /*
     1 /*
     2 * Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). 
     2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
     3 * All rights reserved.
     3 * All rights reserved.
     4 * This component and the accompanying materials are made available
     4 * This component and the accompanying materials are made available
     5 * under the terms of "Eclipse Public License v1.0"
     5 * under the terms of "Eclipse Public License v1.0"
     6 * which accompanies this distribution, and is available
     6 * which accompanies this distribution, and is available
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
    19 #ifndef CESMRSUBJECTFIELD_H
    19 #ifndef CESMRSUBJECTFIELD_H
    20 #define CESMRSUBJECTFIELD_H
    20 #define CESMRSUBJECTFIELD_H
    21 
    21 
    22 #include <e32cmn.h>
    22 #include <e32cmn.h>
    23 #include <eikedwob.h>
    23 #include <eikedwob.h>
    24 #include <AknsControlContext.h>
    24 #include <aknscontrolcontext.h>
    25 
    25 
    26 #include "cesmriconfield.h"
    26 #include "cesmrfield.h"
       
    27 #include "nmrbitmapmanager.h"
    27 
    28 
    28 class CESMREditor;
    29 class CESMREditor;
    29 class MESMRTitlePaneObserver;
    30 class MESMRTitlePaneObserver;
    30 class CAknsFrameBackgroundControlContext;
    31 class CMRImage;
       
    32 class CAknsBasicBackgroundControlContext;
    31 
    33 
    32 /**
    34 /**
    33  * This class is a custom field control that shows the subject of calendar events
    35  * This class is a custom field control that shows the subject of calendar events
    34  */
    36  */
    35 NONSHARABLE_CLASS( CESMRSubjectField ) :
    37 NONSHARABLE_CLASS( CESMRSubjectField ) :
    36         public CESMRIconField,
    38         public CESMRField,
    37         public MEikEdwinSizeObserver,
    39         public MEikEdwinSizeObserver,
    38         public MEikEdwinObserver
    40         public MEikEdwinObserver
    39     {
    41     {
    40 public:
    42 public:
    41     enum TFieldType
    43     enum TFieldType
    53 
    55 
    54     /**
    56     /**
    55      * Destructor.
    57      * Destructor.
    56      */
    58      */
    57     virtual ~CESMRSubjectField();
    59     virtual ~CESMRSubjectField();
    58 
    60     
    59 public: // From CESMRField
    61 public: // Interface
       
    62     void SetTitlePaneObserver( MESMRTitlePaneObserver* aObserver );
       
    63     
       
    64 protected: // From CESMRField
       
    65     TSize MinimumSize();
    60     void InitializeL();
    66     void InitializeL();
    61     void InternalizeL( MESMRCalEntry& aEntry );
    67     void InternalizeL( MESMRCalEntry& aEntry );
    62     void ExternalizeL( MESMRCalEntry& aEntry );
    68     void ExternalizeL( MESMRCalEntry& aEntry );
    63     void SetOutlineFocusL( TBool aFocus );
    69     void SetOutlineFocusL( TBool aFocus );    
    64     TInt ExpandedHeight() const;
    70     void GetCursorLineVerticalPos(TInt& aUpper, TInt& aLower);
    65     void GetMinimumVisibleVerticalArea(TInt& aUpper, TInt& aLower);
       
    66     void ListObserverSet();
    71     void ListObserverSet();
    67     void ExecuteGenericCommandL( TInt aCommand );
    72     TBool ExecuteGenericCommandL( TInt aCommand );
    68 public: // From MEikEdwinSizeObserver
    73 
       
    74 protected: // From MEikEdwinSizeObserver
    69     TBool HandleEdwinSizeEventL( CEikEdwin* aEdwin, TEdwinSizeEvent aType, TSize aSize );
    75     TBool HandleEdwinSizeEventL( CEikEdwin* aEdwin, TEdwinSizeEvent aType, TSize aSize );
    70 
    76 
    71 public: // From MEikEdwinObserver
    77 protected: // From MEikEdwinObserver
    72     void HandleEdwinEventL( CEikEdwin *aEdwin, TEdwinEvent aEventType );
    78     void HandleEdwinEventL(CEikEdwin* aEdwin,TEdwinEvent aEventType);
    73 
    79 
    74 public: // From CCoeControl
    80 protected: // From CCoeControl
    75     void ActivateL();
    81     TInt CountComponentControls() const;
    76     void PositionChanged();
    82     CCoeControl* ComponentControl( TInt aInd ) const;
    77     
    83     void SizeChanged();
    78 public: // Interface
    84     void SetContainerWindowL( const CCoeControl& aContainer );
    79     void SetTitlePaneObserver( MESMRTitlePaneObserver* aObserver );
    85     TKeyResponse OfferKeyEventL( const TKeyEvent& aEvent, 
       
    86                                        TEventCode aType );
    80 
    87 
    81 private:
    88 private:
    82     /**
    89     /**
    83      * Constructor.
    90      * Constructor.
    84      */
    91      */
    89      *
    96      *
    90      * @param aId field id
    97      * @param aId field id
    91      * @param aTextId default text id
    98      * @param aTextId default text id
    92      * @param aIconID icon id
    99      * @param aIconID icon id
    93      */
   100      */
    94     void ConstructL( TESMREntryFieldId aId, TInt aTextId, TAknsItemID aIconID );
   101     void ConstructL( 
    95 
   102             TESMREntryFieldId aId, 
       
   103             TInt aTextId, 
       
   104             NMRBitmapManager::TMRBitmapId aIconID );
       
   105     
       
   106     void SetPriorityIconL( TUint aPriority );
       
   107     
    96 private:
   108 private:
    97     // Not owned. Text editor.
   109     // Not owned. Text editor.
    98     CESMREditor* iSubject;
   110     CESMREditor* iSubject;
    99 
   111     // Own: Field icon
   100     // Field size.
   112     CMRImage* iFieldIcon;
       
   113     // Own: Priority icon
       
   114     CMRImage* iPriorityIcon;
       
   115     // Own: Edwin size
   101     TSize iSize;
   116     TSize iSize;
   102 
       
   103     // Default text id.
       
   104     TInt iTextId;
       
   105 
       
   106     // Not owned
   117     // Not owned
   107     MESMRTitlePaneObserver* iTitlePaneObserver;
   118     MESMRTitlePaneObserver* iTitlePaneObserver;
   108 
   119     // Field editor line count
   109     // Background control context
   120     TInt iLineCount;
   110     MAknsControlContext* iBackground;
   121     // Own: Background for the editor when it is focused
   111 
   122     CAknsBasicBackgroundControlContext* iBgControlContext;
   112     // Actual background for the editor
   123     // Stores current priority value 
   113     CAknsFrameBackgroundControlContext* iFrameBgContext;
   124     TUint iCurrentPriority;
   114     };
   125     };
   115 
   126 
   116 #endif  // CESMRSUBJECTFIELD_H
   127 #endif  // CESMRSUBJECTFIELD_H
   117 
   128