| Start/ | End/ | |||
| True | False | - | Line | Source |
| 1 | /* | |||
| 2 | * =========================================================================== | |||
| 3 | * Name : cvimpstcmdchangeownavtar.cpp | |||
| 4 | * Part of : IMUiServiceTab/vimpstcmdprocess | |||
| 5 | * Description : | |||
| 6 | * Version : %version: 5 % | |||
| 7 | * | |||
| 8 | * Copyright © 2008 Nokia. All rights reserved. | |||
| 9 | * This material, including documentation and any related computer | |||
| 10 | * programs, is protected by copyright controlled by Nokia. All | |||
| 11 | * rights are reserved. Copying, including reproducing, storing, | |||
| 12 | * adapting or translating, any or all of this material requires the | |||
| 13 | * prior written consent of Nokia. This material also contains | |||
| 14 | * confidential information which may not be disclosed to others | |||
| 15 | * without the prior written consent of Nokia. | |||
| 16 | * ============================================================================ | |||
| 17 | */ | |||
| 18 | ||||
| 19 | // INCLUDE FILES | |||
| 20 | #include "cvimpstcmdchangeownavtar.h" | |||
| 21 | ||||
| 22 | #include "vimpstcmd.hrh" | |||
| 23 | #include "mvimpstcmdobserver.h" | |||
| 24 | #include "vimpstdebugprint.h" | |||
| 25 | ||||
| 26 | #include <e32def.h> | |||
| 27 | #include "mvimpstengine.h" | |||
| 28 | #include "mvimpstenginepresencesubservice.h" | |||
| 29 | #include "mvimpstenginesubservice.h" | |||
| 30 | ||||
| 31 | ||||
| 32 | // -------------------------------------------------------------------------- | |||
| 33 | // CVIMPSTCmdChangeOwnAvtar::CVIMPSTCmdChangeOwnAvtar | |||
| 34 | // -------------------------------------------------------------------------- | |||
| 35 | // | |||
| 4 | 4 | 36 | CVIMPSTCmdChangeOwnAvtar::CVIMPSTCmdChangeOwnAvtar( | |
| 37 | const TInt aCommandId ,const TAvatarData& aData, | |||
| 38 | MVIMPSTEngine& aEngine) : | |||
| 39 | iCommandId( aCommandId ), | |||
| 40 | iData(aData), | |||
| 41 | iEngine(aEngine) | |||
| 42 | { | |||
| 43 | } | |||
| 44 | ||||
| 45 | // -------------------------------------------------------------------------- | |||
| 46 | // CVIMPSTCmdChangeOwnAvtar::~CVIMPSTCmdChangeOwnAvtar | |||
| 47 | // -------------------------------------------------------------------------- | |||
| 48 | // | |||
| 4 | 4 | 49 | CVIMPSTCmdChangeOwnAvtar::~CVIMPSTCmdChangeOwnAvtar() | |
| 50 | { | |||
| 51 | ||||
| 52 | } | |||
| 53 | ||||
| 54 | // -------------------------------------------------------------------------- | |||
| 55 | // CVIMPSTCmdChangeOwnAvtar::NewL | |||
| 56 | // -------------------------------------------------------------------------- | |||
| 57 | // | |||
| 4 | 0 | 58 | CVIMPSTCmdChangeOwnAvtar* CVIMPSTCmdChangeOwnAvtar::NewL( | |
| 59 | const TInt aCommandId,const TAvatarData& aData, | |||
| 60 | MVIMPSTEngine& aEngine) | |||
| 61 | { | |||
| 62 | CVIMPSTCmdChangeOwnAvtar* self = new (ELeave ) CVIMPSTCmdChangeOwnAvtar( aCommandId ,aData, aEngine); | |||
| 63 | self->ConstructL(); //use contsurctL if necessary | |||
| 4 | 64 | return self; | ||
| 65 | } | |||
| 66 | // -------------------------------------------------------------------------- | |||
| 67 | // CVIMPSTCmdChangeOwnAvtar::ConstructL | |||
| 68 | // -------------------------------------------------------------------------- | |||
| 69 | // | |||
| 4 | 4 | 70 | void CVIMPSTCmdChangeOwnAvtar::ConstructL() | |
| 71 | { | |||
| 72 | iError = KErrNone; | |||
| 73 | } | |||
| 74 | ||||
| 75 | // -------------------------------------------------------------------------- | |||
| 76 | // CVIMPSTCmdChangeOwnAvtar::ExecuteLD | |||
| 77 | // -------------------------------------------------------------------------- | |||
| 78 | // | |||
| 4 | 4 | 79 | void CVIMPSTCmdChangeOwnAvtar::ExecuteLD() | |
| 80 | { | |||
| 81 | CHAT_DP_FUNC_ENTER("CVIMPSTCmdChangeOwnAvtar::ExecuteLD"); | |||
| 82 | //push to the cleanupstack | |||
| 83 | CleanupStack::PushL( this ); | |||
| 84 | ||||
| 85 | //Get Presence SubService | |||
| 86 | MVIMPSTEngineSubService* subService = | |||
| 87 | (iEngine.SubService(TVIMPSTEnums::EPresence)); | |||
| 4 | 0 | - | 88 | if(subService) |
| 89 | { | |||
| 90 | MVIMPSTEnginePresenceSubService& presence = | |||
| 91 | MVIMPSTEnginePresenceSubService::Cast (*subService); | |||
| 92 | presence.PublishOwnPresenceL(iData.iStatus, iData.iStatusText, iData.iFileName , iData.iMimeType, ETrue ); | |||
| 93 | } | |||
| 94 | ||||
| 95 | CHAT_DP_FUNC_ENTER("CVIMPSTCmdChangeOwnAvtar:: CommandFinished"); | |||
| 96 | ||||
| 2 | 2 | 97 | if(iObserver) | |
| 98 | { | |||
| 99 | iObserver->CommandFinishedL(*this); | |||
| 100 | } | |||
| 101 | CHAT_DP_FUNC_ENTER("CVIMPSTCmdChangeOwnAvtar:: CommandFinished"); | |||
| 102 | CleanupStack::PopAndDestroy(); | |||
| 103 | CHAT_DP_FUNC_DONE("CVIMPSTCmdChangeOwnAvtar::ExecuteLD"); | |||
| 104 | } | |||
| 105 | ||||
| 106 | ||||
| 107 | // -------------------------------------------------------------------------- | |||
| 108 | // CVIMPSTCmdChangeOwnAvtar::AddObserver | |||
| 109 | // -------------------------------------------------------------------------- | |||
| 110 | // | |||
| 2 | 2 | 111 | void CVIMPSTCmdChangeOwnAvtar::AddObserver( MVIMPSTCmdObserver& aObserver ) | |
| 112 | { | |||
| 113 | // store the observer to notify the command completion | |||
| 114 | iObserver = &aObserver; | |||
| 115 | } | |||
| 116 | ||||
| 117 | ||||
| 118 | // -------------------------------------------------------------------------- | |||
| 119 | // CVIMPSTCmdChangeOwnAvtar::CommandId | |||
| 120 | // -------------------------------------------------------------------------- | |||
| 121 | // | |||
| 4 | 0 | 122 | TInt CVIMPSTCmdChangeOwnAvtar::CommandId() const | |
| 123 | { | |||
| 4 | 124 | return iCommandId; | ||
| 125 | } | |||
| 126 | ||||
| 127 | // -------------------------------------------------------------------------- | |||
| 128 | // CVIMPSTCmdChangeOwnAvtar::Result | |||
| 129 | // -------------------------------------------------------------------------- | |||
| 130 | // | |||
| 2 | 0 | 131 | TInt CVIMPSTCmdChangeOwnAvtar::Result() const | |
| 132 | { | |||
| 133 | //return valid data regd the command operation | |||
| 2 | 134 | return iError; | ||
| 135 | } | |||
| 136 | ||||
| 137 | // End of File | |||
| ***TER 93% (14/15) of SOURCE FILE cvimpstcmdchangeownavtar.cpp | ||||