meetingui/meetingrequestviewers/src/CMRResponseModel.cpp
changeset 89 b57382753122
parent 0 f979ecb2b13e
equal deleted inserted replaced
83:5aadd1120515 89:b57382753122
       
     1 /*
       
     2 * Copyright (c) 2002-2004 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:   Model for method RESPONSE
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 // INCLUDE FILES
       
    22 #include "CMRResponseModel.h"
       
    23 #include "CMRModelBase.h"
       
    24 #include "MMRDataFillerInterface.h"
       
    25 #include "CMRDataFillerReply.h"
       
    26 #include <eikenv.h> //CEikonEnv
       
    27 #include <CRichBio.h> //rich bio
       
    28 #include "CMRUtilsInternal.h"
       
    29 #include <MsgMailUIDs.h> //uid for mail application
       
    30 #include <stringloader.h>
       
    31 #include <avkon.rsg> // resouce identifiers
       
    32 #include <calcommon.h> //TCalTimeRange
       
    33 #include <senduimtmuids.h> //mailbox id's
       
    34 #include "MRViewersPanic.h"
       
    35 #include <MRCommands.hrh>
       
    36 
       
    37 // CONSTANTS
       
    38 /// Unnamed namespace for local definitions
       
    39 namespace {
       
    40 
       
    41 _LIT( KPanicMsg, "CMRResponseModel" );
       
    42 
       
    43 void Panic( TPanicCode aReason )
       
    44     {
       
    45     User::Panic( KPanicMsg, aReason );
       
    46     }
       
    47 
       
    48 }  // namespace
       
    49 
       
    50 // ============================ MEMBER FUNCTIONS ===============================
       
    51 
       
    52 // -----------------------------------------------------------------------------
       
    53 // ?classname::?classname
       
    54 // C++ default constructor can NOT contain any code, that
       
    55 // might leave.
       
    56 // -----------------------------------------------------------------------------
       
    57 //
       
    58 CMRResponseModel::CMRResponseModel(
       
    59     CMRMailboxUtils& aMRMailboxUtils,
       
    60     CMRUtilsInternal& aMRUtils,
       
    61     const MAgnEntryUi::TAgnEntryUiInParams& aInParams )
       
    62     : CMRModelBase( aMRMailboxUtils, aMRUtils, aInParams )
       
    63     {
       
    64     }
       
    65 
       
    66 // -----------------------------------------------------------------------------
       
    67 // ?classname::ConstructL
       
    68 // Symbian 2nd phase constructor can leave.
       
    69 // -----------------------------------------------------------------------------
       
    70 //
       
    71 void CMRResponseModel::ConstructL( RPointerArray<CCalEntry>& aEntries )
       
    72     {
       
    73     CMRModelBase::ConstructL( aEntries );
       
    74     }
       
    75 
       
    76 // -----------------------------------------------------------------------------
       
    77 // ?classname::NewL
       
    78 // Two-phased constructor.
       
    79 // -----------------------------------------------------------------------------
       
    80 //
       
    81 CMRResponseModel* CMRResponseModel::NewL(
       
    82     RPointerArray<CCalEntry>& aEntries,
       
    83     CMRMailboxUtils& aMRMailboxUtils,
       
    84     CMRUtilsInternal& aMRUtils,
       
    85     const MAgnEntryUi::TAgnEntryUiInParams& aInParams )
       
    86     {
       
    87     CMRResponseModel* self = new( ELeave ) CMRResponseModel( aMRMailboxUtils,
       
    88                                                              aMRUtils,
       
    89                                                              aInParams );
       
    90 
       
    91     CleanupStack::PushL( self );
       
    92     self->ConstructL( aEntries );
       
    93     CleanupStack::Pop();
       
    94 
       
    95     return self;
       
    96     }
       
    97 
       
    98 // Destructor
       
    99 CMRResponseModel::~CMRResponseModel()
       
   100     {
       
   101     }
       
   102 
       
   103 MMRModelInterface::TClosingStatus CMRResponseModel::ClosingStatusL()
       
   104 	{
       
   105 	TClosingStatus retVal( ENone );
       
   106 	return retVal;
       
   107 	}
       
   108 
       
   109 MMRDataFillerInterface* CMRResponseModel::DataFillerL( CRichBio* aRichBio )
       
   110 	{
       
   111 	__ASSERT_DEBUG(aRichBio,Panic(ECRichBioNull));
       
   112 	MMRDataFillerInterface* dataFillerInterface(NULL);
       
   113 	dataFillerInterface = CMRDataFillerReply::NewL( *aRichBio,
       
   114 	                                                *this,
       
   115 	                                                *CEikonEnv::Static(),
       
   116 	                                                iMRMailboxUtils,
       
   117 	                                                iInParams );
       
   118 	return dataFillerInterface;
       
   119 	}
       
   120 
       
   121 TBool CMRResponseModel::IsCmdAvailableL( TInt aCommandId )
       
   122     {
       
   123     TInt retVal( EFalse );
       
   124     if ( aCommandId == EMRCommandReplyToSender )
       
   125         {
       
   126         retVal = ETrue;
       
   127         }
       
   128     else
       
   129         {        
       
   130         retVal = CMRModelBase::IsCmdAvailableL( aCommandId );
       
   131         }
       
   132     return retVal;
       
   133     }
       
   134 
       
   135 //  End of File