meetingrequest/mrgui/inc/mesmrfieldstorage.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: This file defines class MESMRFieldStorage.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef MESMRFIELDSTORAGE_H
       
    20 #define MESMRFIELDSTORAGE_H
       
    21 
       
    22 #include <e32std.h>
       
    23 #include "esmrdef.h" // TESMREntryFieldId
       
    24 
       
    25 class MESMRCalEntry;
       
    26 class CESMRField;
       
    27 class CESMRPolicy;
       
    28 
       
    29 /**
       
    30  * Pure virtual class to be inherited by field storage classes.
       
    31  */
       
    32 class MESMRFieldStorage
       
    33     {
       
    34 public:
       
    35     virtual ~MESMRFieldStorage(){}
       
    36 public:
       
    37     /**
       
    38      * Returns the count for all the fields in the storage
       
    39      *
       
    40      * @return TInt - field count
       
    41      */
       
    42     virtual TInt Count() const = 0;
       
    43 
       
    44     /**
       
    45      * Returns field for given index.
       
    46      *
       
    47      * @param aInd - index of the wanted field.
       
    48      * @return CESMRField pointer
       
    49      */
       
    50     virtual CESMRField* Field( TInt aInd ) const = 0;
       
    51 
       
    52     /**
       
    53      * Returns field for given field id.
       
    54      * 
       
    55      * @param aId field id
       
    56      * @return CESMRField poiter or NULL. 
       
    57      */
       
    58     virtual CESMRField* FieldById( TESMREntryFieldId aId ) const = 0;
       
    59     
       
    60     /**
       
    61      * Called in the construction phase to set needed
       
    62      * entry informations to fields.
       
    63      *
       
    64      * @param aEntry - contains needed information.
       
    65      */
       
    66     virtual void InternalizeL( MESMRCalEntry& aEntry ) = 0;
       
    67 
       
    68     /**
       
    69      * Called when editing the entry is done. Information from edited fields
       
    70      * is collected to aEntry.
       
    71      *
       
    72      * @param aEntry - entry where all the edited information is stored
       
    73      */
       
    74     virtual void ExternalizeL( MESMRCalEntry& aEntry ) = 0;
       
    75 
       
    76     /**
       
    77      * Validates the content of fields
       
    78      *
       
    79      * @param aId Field id where focus is set if validation fails
       
    80      * @param aForceValidate ETrue if force validation is used
       
    81      * @return TInt
       
    82      */
       
    83     virtual TInt Validate( 
       
    84     		TESMREntryFieldId& aId, 
       
    85     		TBool aForceValidate = EFalse ) = 0;
       
    86     
       
    87     /**
       
    88      * Updates storage on policy change.
       
    89      * 
       
    90      * @param aNewPolicy the new policy to adjust the storage.
       
    91      * @param aEntry the entry to handle.
       
    92      */
       
    93     virtual void ChangePolicyL( const CESMRPolicy& aNewPolicy,
       
    94                                 MESMRCalEntry& aEntry ) = 0;
       
    95     };
       
    96 
       
    97 #endif