meetingrequest/mrgui/src/cesmrviewerfieldstorage.cpp
branchRCL_3
changeset 12 4ce476e64c59
parent 0 8466d47a6819
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".
    10 * Nokia Corporation - initial contribution.
    10 * Nokia Corporation - initial contribution.
    11 *
    11 *
    12 * Contributors:
    12 * Contributors:
    13 *
    13 *
    14 *  Description : Storage for viewer fields
    14 *  Description : Storage for viewer fields
    15 *  Version     : %version: tr1sido#6 %
    15 *  Version     : %version: e002sa33#8 %
    16 *
    16 *
    17 */
    17 */
    18 
    18 
    19 #include "emailtrace.h"
    19 #include "emailtrace.h"
    20 #include "cesmrviewerfieldstorage.h"
    20 #include "cesmrviewerfieldstorage.h"
    63 // ---------------------------------------------------------------------------
    63 // ---------------------------------------------------------------------------
    64 // CESMRViewerFieldStorage::NewL
    64 // CESMRViewerFieldStorage::NewL
    65 // ---------------------------------------------------------------------------
    65 // ---------------------------------------------------------------------------
    66 //
    66 //
    67 CESMRViewerFieldStorage* CESMRViewerFieldStorage::NewL(
    67 CESMRViewerFieldStorage* CESMRViewerFieldStorage::NewL(
    68         CESMRPolicy* aPolicy,
    68         const CESMRPolicy& aPolicy,
    69         MESMRResponseObserver* aResponseObserver,
    69         MESMRResponseObserver* aResponseObserver,
    70         TBool aResponseReady,
    70         TBool aResponseReady,
    71         MESMRFieldEventObserver& aEventObserver,
    71         MESMRFieldEventObserver& aEventObserver,
    72         TInt aReqAttendee,
    72         TInt aReqAttendee,
    73         TInt aOptAttendee )
    73         TInt aOptAttendee )
    86 // ---------------------------------------------------------------------------
    86 // ---------------------------------------------------------------------------
    87 // CESMRViewerFieldStorage::ConstructL
    87 // CESMRViewerFieldStorage::ConstructL
    88 // ---------------------------------------------------------------------------
    88 // ---------------------------------------------------------------------------
    89 //
    89 //
    90 void CESMRViewerFieldStorage::ConstructL(
    90 void CESMRViewerFieldStorage::ConstructL(
    91         CESMRPolicy* aPolicy,
    91         const CESMRPolicy& aPolicy,
    92         MESMRResponseObserver* aResponseObserver,
    92         MESMRResponseObserver* aResponseObserver,
    93         TBool aResponseReady,
    93         TBool aResponseReady,
    94         const TInt &aReqAttendee,
    94         const TInt &aReqAttendee,
    95         const TInt &aOptAttendee
    95         const TInt &aOptAttendee
    96         )
    96         )
   125 
   125 
   126 // ---------------------------------------------------------------------------
   126 // ---------------------------------------------------------------------------
   127 // CESMRViewerFieldStorage::CreatePolicyFieldsL
   127 // CESMRViewerFieldStorage::CreatePolicyFieldsL
   128 // ---------------------------------------------------------------------------
   128 // ---------------------------------------------------------------------------
   129 //
   129 //
   130 void CESMRViewerFieldStorage::CreatePolicyFieldsL(CESMRPolicy* aPolicy,
   130 void CESMRViewerFieldStorage::CreatePolicyFieldsL(
       
   131         const CESMRPolicy& aPolicy,
   131         MESMRResponseObserver* aResponseObserver,
   132         MESMRResponseObserver* aResponseObserver,
   132         TBool aResponseReady)
   133         TBool aResponseReady)
   133     {
   134     {
   134     FUNC_LOG;
   135     FUNC_LOG;
   135     CESMRField* field = NULL;
   136     CESMRField* field = NULL;
   136     
   137     
   137     RArray<TESMREntryField> fields = aPolicy->Fields();
   138     RArray<TESMREntryField> fields = aPolicy.Fields();
   138     const TInt count = fields.Count();
   139     const TInt count = fields.Count();
   139     for ( TInt i(0); i < count ; i++ )
   140     for ( TInt i(0); i < count ; i++ )
   140         {
   141         {
   141         field = CreateViewerFieldL( 
   142         field = CreateViewerFieldL( 
   142         		aResponseObserver, fields[i], aResponseReady );
   143         		aResponseObserver, fields[i], aResponseReady );
   143 
   144 
   144         TBool visible( ETrue );
   145         TBool visible( ETrue );
   145             
   146                    
   146         switch ( fields[i].iFieldId )
       
   147             {
       
   148             case EESMRFieldResponseArea:
       
   149                 {
       
   150                 if ( aResponseReady )
       
   151                     {
       
   152                     visible = EFalse;
       
   153                     }
       
   154                 break;
       
   155                 }
       
   156             case EESMRFieldResponseReadyArea:
       
   157                 {
       
   158                 if ( !aResponseReady )
       
   159                     {
       
   160                     visible = EFalse;
       
   161                     }
       
   162                 break;
       
   163                 }
       
   164             default:
       
   165                 {
       
   166                 break;
       
   167                 }
       
   168             }
       
   169         
       
   170         CleanupStack::PushL( field );
   147         CleanupStack::PushL( field );
   171         AddFieldL( field, visible );
   148         AddFieldL( field, visible );
   172         CleanupStack::Pop( field );
   149         CleanupStack::Pop( field );
   173         }
   150         }
   174     }
   151     }
   175 
   152 
   176 // ---------------------------------------------------------------------------
   153 // ---------------------------------------------------------------------------
   177 // CESMRViewerFieldStorage::CreateTrackingFieldsL
   154 // CESMRViewerFieldStorage::CreateTrackingFieldsL
   178 // ---------------------------------------------------------------------------
   155 // ---------------------------------------------------------------------------
   179 //
   156 //
   180 void CESMRViewerFieldStorage::CreateTrackingFieldsL(CESMRPolicy* aPolicy,
   157 void CESMRViewerFieldStorage::CreateTrackingFieldsL(
       
   158         const CESMRPolicy& aPolicy,
   181         MESMRResponseObserver* aResponseObserver,
   159         MESMRResponseObserver* aResponseObserver,
   182         TBool aResponseReady,
   160         TBool aResponseReady,
   183         const TInt &aReqAttendee,
   161         const TInt &aReqAttendee,
   184         const TInt &aOptAttendee)
   162         const TInt &aOptAttendee)
   185     {
   163     {
   186     FUNC_LOG;
   164     FUNC_LOG;
   187     CESMRField* field = NULL;
   165     CESMRField* field = NULL;
   188     RArray<TESMREntryField> fields = aPolicy->Fields();
   166     RArray<TESMREntryField> fields = aPolicy.Fields();
   189 
   167 
   190     if (aReqAttendee > 0)
   168     if (aReqAttendee > 0)
   191         {
   169         {
   192         //create "required attendee" label
   170         //create "required attendee" label
   193         field = CreateViewerFieldL( 
   171         field = CreateViewerFieldL(