meetingrequest/mrgui/inc/cesmrfieldstorage.h
changeset 0 8466d47a6819
child 16 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 field storage definition
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef CESMRFIELDSTORAGE_H
       
    19 #define CESMRFIELDSTORAGE_H
       
    20 
       
    21 #include <e32base.h>
       
    22 //<cmail>
       
    23 #include "esmrdef.h"
       
    24 //</cmail>
       
    25 #include "mesmrfieldstorage.h"
       
    26 #include "cesmrfieldbuilderinterface.h"
       
    27 
       
    28 class CESMRField;
       
    29 class MESMRCalEntry;
       
    30 class MESMRFieldEventObserver;
       
    31 class CESMRFieldEventQueue;
       
    32 
       
    33 /**
       
    34  * CESMRFieldStorage is a base class for different storage classes.
       
    35  * Storage class owns the fields needed to draw UI. This class also has methods
       
    36  * to add new fields into field array.
       
    37  *
       
    38  * fields for the ui are created are created in a separate ecom plugin 
       
    39  * loaded here
       
    40  */
       
    41 NONSHARABLE_CLASS( CESMRFieldStorage ): public CBase, 
       
    42 										public MESMRFieldStorage
       
    43     {
       
    44 public:
       
    45     // Destructor
       
    46     virtual ~CESMRFieldStorage();
       
    47 
       
    48 public:
       
    49     /**
       
    50      * Adds new field into field array.
       
    51      *
       
    52      * @param aField - field to be added
       
    53      */
       
    54     void AddFieldL( CESMRField* aField );
       
    55 
       
    56     /**
       
    57      * Adds new field into field array.
       
    58      *
       
    59      * @param aField - field to be added
       
    60      * @param aVisible - is this field visible by default ot not.
       
    61      */
       
    62     void AddFieldL( CESMRField* aField, TBool aVisible );
       
    63 
       
    64    /**
       
    65      * Creates editor field.
       
    66      *
       
    67      * @param aValidator - time validator
       
    68      * @param aField - field to be created
       
    69      */
       
    70     CESMRField* CreateEditorFieldL(
       
    71                 MESMRFieldValidator* aValidator,
       
    72                 TESMREntryField aField );
       
    73 
       
    74     /**
       
    75      * Creates viewer field.
       
    76      *
       
    77      * @param aResponseObserver - observer to be called when e.g.
       
    78      *                            answer is ready to be sent.
       
    79      * @param aField - field to be created
       
    80      * @param aResponseReady - NOT IN USE
       
    81      */
       
    82     CESMRField* CreateViewerFieldL(
       
    83                 MESMRResponseObserver* aResponseObserver,
       
    84                 TESMREntryField aField,
       
    85                 TBool aResponseReady );
       
    86 
       
    87 public: // From MESMRFieldStorage
       
    88     TInt Count() const;
       
    89     CESMRField* Field( TInt aInd ) const;
       
    90     CESMRField* FieldById( TESMREntryFieldId aId ) const;
       
    91     virtual void InternalizeL( MESMRCalEntry& aEntry );
       
    92     virtual void ExternalizeL( MESMRCalEntry& aEntry );
       
    93     virtual TInt Validate( TESMREntryFieldId& aId, TBool aForceValidate );
       
    94 
       
    95 protected:
       
    96     // C++ constructor
       
    97     CESMRFieldStorage(
       
    98             MESMRFieldEventObserver& aEventObserver );
       
    99 
       
   100     void BaseConstructL();
       
   101     
       
   102     CESMRFieldEventQueue& EventQueueL();
       
   103     
       
   104 private:
       
   105     /**
       
   106      * loads fieldbuilder ecom plugin
       
   107      * delayed until the first time the plugin is needed
       
   108      */
       
   109     void LoadPluginL();
       
   110 
       
   111     MESMRFieldBuilder* FieldBuilderL();    
       
   112 
       
   113 private:
       
   114     /// Own: Array that owns all the fields
       
   115     RPointerArray< CESMRField > iArray;
       
   116     /// Own: ecom field builder interface
       
   117     CESMRFieldBuilderInterface* iPlugin;
       
   118     /// Ref: composite class of field builder interface
       
   119     MESMRFieldBuilder* iFieldBuilder;
       
   120     /// Ref: Event observer
       
   121     MESMRFieldEventObserver& iEventObserver;
       
   122     /// Own: Event Queue
       
   123     CESMRFieldEventQueue* iEventQueue;
       
   124     };
       
   125 
       
   126 #endif // CESMRFIELDSTORAGE_H
       
   127 
       
   128 // EOF
       
   129