meetingrequest/mrgui/mrfieldbuilderplugin/inc/cesmrsubjectfield.h
changeset 0 8466d47a6819
child 12 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 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 "cesmriconfield.h"
       
    27 
       
    28 class CESMREditor;
       
    29 class MESMRTitlePaneObserver;
       
    30 class CAknsFrameBackgroundControlContext;
       
    31 
       
    32 /**
       
    33  * This class is a custom field control that shows the subject of calendar events
       
    34  */
       
    35 NONSHARABLE_CLASS( CESMRSubjectField ) :
       
    36         public CESMRIconField,
       
    37         public MEikEdwinSizeObserver,
       
    38         public MEikEdwinObserver
       
    39     {
       
    40 public:
       
    41     enum TFieldType
       
    42         {
       
    43         ETypeSubject = 0,
       
    44         ETypeOccasion
       
    45         };
       
    46 
       
    47     /**
       
    48      * Creates new CESMRSubjectField object. Ownership
       
    49      * is transferred to caller.
       
    50      * @return Pointer to created object,
       
    51      */
       
    52     static CESMRSubjectField* NewL( TFieldType aType = ETypeSubject );
       
    53 
       
    54     /**
       
    55      * Destructor.
       
    56      */
       
    57     virtual ~CESMRSubjectField();
       
    58 
       
    59 public: // From CESMRField
       
    60     void InitializeL();
       
    61     void InternalizeL( MESMRCalEntry& aEntry );
       
    62     void ExternalizeL( MESMRCalEntry& aEntry );
       
    63     void SetOutlineFocusL( TBool aFocus );
       
    64     TInt ExpandedHeight() const;
       
    65     void GetMinimumVisibleVerticalArea(TInt& aUpper, TInt& aLower);
       
    66     void ListObserverSet();
       
    67     void ExecuteGenericCommandL( TInt aCommand );
       
    68 public: // From MEikEdwinSizeObserver
       
    69     TBool HandleEdwinSizeEventL( CEikEdwin* aEdwin, TEdwinSizeEvent aType, TSize aSize );
       
    70 
       
    71 public: // From MEikEdwinObserver
       
    72     void HandleEdwinEventL( CEikEdwin *aEdwin, TEdwinEvent aEventType );
       
    73 
       
    74 public: // From CCoeControl
       
    75     void ActivateL();
       
    76     void PositionChanged();
       
    77     
       
    78 public: // Interface
       
    79     void SetTitlePaneObserver( MESMRTitlePaneObserver* aObserver );
       
    80 
       
    81 private:
       
    82     /**
       
    83      * Constructor.
       
    84      */
       
    85     CESMRSubjectField();
       
    86 
       
    87     /**
       
    88      * Second phase constructor.
       
    89      *
       
    90      * @param aId field id
       
    91      * @param aTextId default text id
       
    92      * @param aIconID icon id
       
    93      */
       
    94     void ConstructL( TESMREntryFieldId aId, TInt aTextId, TAknsItemID aIconID );
       
    95 
       
    96 private:
       
    97     // Not owned. Text editor.
       
    98     CESMREditor* iSubject;
       
    99 
       
   100     // Field size.
       
   101     TSize iSize;
       
   102 
       
   103     // Default text id.
       
   104     TInt iTextId;
       
   105 
       
   106     // Not owned
       
   107     MESMRTitlePaneObserver* iTitlePaneObserver;
       
   108 
       
   109     // Background control context
       
   110     MAknsControlContext* iBackground;
       
   111 
       
   112     // Actual background for the editor
       
   113     CAknsFrameBackgroundControlContext* iFrameBgContext;
       
   114     };
       
   115 
       
   116 #endif  // CESMRSUBJECTFIELD_H
       
   117