meetingrequest/mrgui/mrfieldbuilderplugin/inc/cesmrpriorityfield.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 priority field implementation
       
    15  *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef CESMRPRIORITYFIELD_H
       
    20 #define CESMRPRIORITYFIELD_H
       
    21 
       
    22 #include "cesmrfield.h"
       
    23 #include "cesmrpriority.h"
       
    24 #include "mesmrcalentry.h"
       
    25 
       
    26 class CMRImage;
       
    27 class CMRLabel;
       
    28 
       
    29 NONSHARABLE_CLASS( CESMRPriorityField ): public CESMRField
       
    30     {
       
    31 public:
       
    32     /**
       
    33      * Creates new CESMRPriorityField object. Ownership
       
    34      * is transferred to caller.
       
    35      * @return Pointer to created object,
       
    36      */
       
    37     static CESMRPriorityField* NewL();
       
    38 
       
    39     /**
       
    40      * C++ Destructor.
       
    41      */
       
    42     ~CESMRPriorityField();
       
    43 
       
    44 public: // From base class CESMRField
       
    45     void InitializeL();
       
    46     void InternalizeL( MESMRCalEntry& aEntry );
       
    47     void ExternalizeL( MESMRCalEntry& aEntry );
       
    48     TBool ExecuteGenericCommandL( TInt aCommand );
       
    49     void SetOutlineFocusL( TBool aFocus );
       
    50 
       
    51 public: // From base class CCoeControl
       
    52     TKeyResponse OfferKeyEventL(const TKeyEvent& aEvent, TEventCode aType);
       
    53     void SizeChanged();
       
    54     TInt CountComponentControls() const;
       
    55     CCoeControl* ComponentControl( TInt aIndex ) const;    
       
    56     
       
    57 private: // Implementation
       
    58     /**
       
    59      * Constructor.
       
    60      */
       
    61     CESMRPriorityField();
       
    62 
       
    63     /**
       
    64      * Second phase constructor.
       
    65      */
       
    66     void ConstructL();
       
    67 
       
    68     /**
       
    69      * Updates priority to given index.
       
    70      *
       
    71      * @param aIndex index
       
    72      */
       
    73     void UpdateTextL( TInt aIndex );
       
    74 
       
    75     /**
       
    76      * Shows query dialog for selecting
       
    77      * priority
       
    78      *
       
    79      */
       
    80     void ExecutePriorityQueryL();
       
    81 
       
    82 private:
       
    83 
       
    84     /**
       
    85      * Own. Array of available priorities.
       
    86      */
       
    87     RPointerArray< CESMRPriority > iArray;
       
    88 
       
    89     /**
       
    90      * Selected priority index.
       
    91      */
       
    92     TInt iIndex;
       
    93 
       
    94     /**
       
    95      * Entry type
       
    96      */
       
    97     MESMRCalEntry::TESMRCalEntryType iEntryType;
       
    98     
       
    99     /**
       
   100      * Owned: Field icon
       
   101      */
       
   102     CMRImage* iIcon;
       
   103 
       
   104     /**
       
   105      * Not own: Field text label
       
   106      */
       
   107     CMRLabel* iLabel;    
       
   108     };
       
   109 
       
   110 #endif  // CESMRPRIORITYFIELD_H
       
   111