meetingrequest/mrcasplugin/src/cesmrcascontactaction.cpp
changeset 0 8466d47a6819
child 12 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:  Implementation of the class CESMRCasContactAction.
       
    15  *
       
    16 */
       
    17 
       
    18 
       
    19 #include "emailtrace.h"
       
    20 #include "cesmrcascontactaction.h"
       
    21 #include <StringLoader.h>
       
    22 #include <gulicon.h>
       
    23 
       
    24 // ======== MEMBER FUNCTIONS ========
       
    25 
       
    26 // ---------------------------------------------------------------------------
       
    27 // CESMRCasContactAction::NewL
       
    28 // ---------------------------------------------------------------------------
       
    29 //
       
    30 CESMRCasContactAction* CESMRCasContactAction::NewL(
       
    31         MFscReasonCallback& aReasonCallback,
       
    32         TUid aContactActionUid,
       
    33         TUint64 aActionType, TInt aActionMenuTextResourceId, CGulIcon* aIcon )
       
    34     {
       
    35     FUNC_LOG;
       
    36 
       
    37     CESMRCasContactAction* self =new ( ELeave ) CESMRCasContactAction(
       
    38             aReasonCallback,
       
    39             aContactActionUid,
       
    40             aActionType,
       
    41             aIcon);
       
    42 
       
    43     CleanupStack::PushL ( self );
       
    44     self->ConstructL (aActionMenuTextResourceId);
       
    45     CleanupStack::Pop ( self );
       
    46 
       
    47 
       
    48     return self;
       
    49     }
       
    50 
       
    51 // ---------------------------------------------------------------------------
       
    52 // CESMRCasContactAction::~CESMRCasContactAction
       
    53 // ---------------------------------------------------------------------------
       
    54 //
       
    55 CESMRCasContactAction::~CESMRCasContactAction( )
       
    56     {
       
    57     FUNC_LOG;
       
    58 
       
    59     delete iIcon;
       
    60     delete iActionMenuText;
       
    61 
       
    62     }
       
    63 
       
    64 // ---------------------------------------------------------------------------
       
    65 // CESMRCasContactAction::Uid
       
    66 // ---------------------------------------------------------------------------
       
    67 //
       
    68 TUid CESMRCasContactAction::Uid( ) const
       
    69     {
       
    70     FUNC_LOG;
       
    71 
       
    72     return iContactActionUid;
       
    73     }
       
    74 
       
    75 // ---------------------------------------------------------------------------
       
    76 // CESMRCasContactAction::Type
       
    77 // ---------------------------------------------------------------------------
       
    78 //
       
    79 TUint64 CESMRCasContactAction::Type( ) const
       
    80     {
       
    81     FUNC_LOG;
       
    82 
       
    83     return iActionType;
       
    84     }
       
    85 
       
    86 // ---------------------------------------------------------------------------
       
    87 // CESMRCasContactAction::Icon
       
    88 // ---------------------------------------------------------------------------
       
    89 //
       
    90 const CGulIcon* CESMRCasContactAction::Icon( ) const
       
    91     {
       
    92     FUNC_LOG;
       
    93 
       
    94     return iIcon;
       
    95     }
       
    96 
       
    97 // ---------------------------------------------------------------------------
       
    98 // CESMRCasContactAction::ActionMenuText
       
    99 // ---------------------------------------------------------------------------
       
   100 //
       
   101 const TDesC& CESMRCasContactAction::ActionMenuText( ) const
       
   102     {
       
   103     FUNC_LOG;
       
   104 
       
   105     return *iActionMenuText;
       
   106     }
       
   107 
       
   108 // ---------------------------------------------------------------------------
       
   109 // CESMRCasContactAction::ReasonL
       
   110 // ---------------------------------------------------------------------------
       
   111 //
       
   112 void CESMRCasContactAction::ReasonL(TInt aReasonId, HBufC*& aReason ) const
       
   113     {
       
   114     FUNC_LOG;
       
   115 
       
   116     iReasonCallback.GetReasonL( iContactActionUid, aReasonId, aReason );
       
   117 
       
   118     }
       
   119 
       
   120 // ---------------------------------------------------------------------------
       
   121 // CESMRCasContactAction::CESMRCasContactAction
       
   122 // ---------------------------------------------------------------------------
       
   123 //
       
   124 CESMRCasContactAction::CESMRCasContactAction(
       
   125         MFscReasonCallback& aReasonCallback,
       
   126         TUid aContactActionUid,
       
   127         TUint64 aActionType,
       
   128         CGulIcon* aIcon )
       
   129 :   iContactActionUid(aContactActionUid),
       
   130     iActionType(aActionType),
       
   131     iIcon(aIcon),
       
   132     iReasonCallback(aReasonCallback)
       
   133     {
       
   134     FUNC_LOG;
       
   135     //do nothing
       
   136     }
       
   137 
       
   138 // ---------------------------------------------------------------------------
       
   139 // CESMRCasContactAction::ConstructL
       
   140 // ---------------------------------------------------------------------------
       
   141 //
       
   142 void CESMRCasContactAction::ConstructL(TInt aActionMenuTextResourceId)
       
   143     {
       
   144     FUNC_LOG;
       
   145 
       
   146     iActionMenuText = StringLoader::LoadL ( aActionMenuTextResourceId );
       
   147 
       
   148 
       
   149     }
       
   150 
       
   151 // ======== GLOBAL FUNCTIONS ========
       
   152