| Start/ | End/ | |||
| True | False | - | Line | Source |
| 1 | /* | |||
| 2 | * =========================================================================== | |||
| 3 | * Name : cvimpstcmdcloseconversation.cpp | |||
| 4 | * Part of : IMUiServiceTab/vimpstcmdprocess | |||
| 5 | * Description : | |||
| 6 | * Version : %version: 3 % | |||
| 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 "cvimpstcmdcloseconversation.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 "mvimpstenginesubservice.h" | |||
| 29 | #include "mvimpstengineimsubservice.h" | |||
| 30 | ||||
| 31 | // Constants | |||
| 32 | ||||
| 33 | // -------------------------------------------------------------------------- | |||
| 34 | // CVIMPSTCmdCloseConversation::CVIMPSTCmdCloseConversation | |||
| 35 | // -------------------------------------------------------------------------- | |||
| 36 | // | |||
| 4 | 4 | 37 | CVIMPSTCmdCloseConversation::CVIMPSTCmdCloseConversation( const TInt aCommandId, | |
| 38 | const TDesC& aContactId, | |||
| 39 | MVIMPSTEngine& aEngine ): | |||
| 40 | iCommandId( aCommandId ), | |||
| 41 | iContactId( aContactId ), | |||
| 42 | iEngine(aEngine) | |||
| 43 | { | |||
| 44 | } | |||
| 45 | ||||
| 46 | // -------------------------------------------------------------------------- | |||
| 47 | // CVIMPSTCmdCloseConversation::~CVIMPSTCmdCloseConversation | |||
| 48 | // -------------------------------------------------------------------------- | |||
| 49 | // | |||
| 4 | 4 | 50 | CVIMPSTCmdCloseConversation::~CVIMPSTCmdCloseConversation() | |
| 51 | { | |||
| 52 | ||||
| 53 | } | |||
| 54 | ||||
| 55 | // -------------------------------------------------------------------------- | |||
| 56 | // CVIMPSTCmdCloseConversation::NewL | |||
| 57 | // -------------------------------------------------------------------------- | |||
| 58 | // | |||
| 4 | 0 | 59 | CVIMPSTCmdCloseConversation* CVIMPSTCmdCloseConversation::NewL( const TInt aCommandId, | |
| 60 | const TDesC& aContactId, | |||
| 61 | MVIMPSTEngine& aEngine ) | |||
| 62 | { | |||
| 63 | CVIMPSTCmdCloseConversation* self = new (ELeave ) CVIMPSTCmdCloseConversation( aCommandId ,aContactId, aEngine); | |||
| 64 | self->ConstructL(); //use contsurctL if necessary | |||
| 4 | 65 | return self; | ||
| 66 | } | |||
| 67 | // -------------------------------------------------------------------------- | |||
| 68 | // CVIMPSTCmdCloseConversation::ConstructL | |||
| 69 | // -------------------------------------------------------------------------- | |||
| 70 | // | |||
| 4 | 4 | 71 | void CVIMPSTCmdCloseConversation::ConstructL() | |
| 72 | { | |||
| 73 | iError = KErrNone; | |||
| 74 | } | |||
| 75 | ||||
| 76 | // -------------------------------------------------------------------------- | |||
| 77 | // CVIMPSTCmdCloseConversation::ExecuteLD | |||
| 78 | // -------------------------------------------------------------------------- | |||
| 79 | // | |||
| 4 | 4 | 80 | void CVIMPSTCmdCloseConversation::ExecuteLD() | |
| 81 | { | |||
| 82 | CHAT_DP_FUNC_ENTER("CVIMPSTCmdCloseConversation::ExecuteLD"); | |||
| 83 | //push to the cleanupstack | |||
| 84 | CleanupStack::PushL( this ); | |||
| 85 | ||||
| 86 | //Get IM SubService | |||
| 87 | MVIMPSTEngineSubService* subService1 = | |||
| 88 | (iEngine.SubService(TVIMPSTEnums::EIM)); | |||
| 89 | ||||
| 0 | 4 | - | 90 | if(subService1) |
| 91 | { | |||
| 92 | MVIMPSTEngineIMSubService& imSubService = | |||
| 93 | MVIMPSTEngineIMSubService::Cast (*subService1); | |||
| 94 | imSubService.CloseConversationL( iContactId ); | |||
| 95 | } | |||
| 96 | ||||
| 2 | 2 | 97 | if(iObserver) | |
| 98 | { | |||
| 99 | iObserver->CommandFinishedL(*this); | |||
| 100 | } | |||
| 101 | ||||
| 102 | CHAT_DP_FUNC_ENTER("CVIMPSTCmdCloseConversation:: CommandFinished"); | |||
| 103 | CleanupStack::PopAndDestroy(); | |||
| 104 | CHAT_DP_FUNC_DONE("CVIMPSTCmdCloseConversation::ExecuteLD"); | |||
| 105 | } | |||
| 106 | ||||
| 107 | ||||
| 108 | // -------------------------------------------------------------------------- | |||
| 109 | // CVIMPSTCmdCloseConversation::AddObserver | |||
| 110 | // -------------------------------------------------------------------------- | |||
| 111 | // | |||
| 2 | 2 | 112 | void CVIMPSTCmdCloseConversation::AddObserver( MVIMPSTCmdObserver& aObserver ) | |
| 113 | { | |||
| 114 | // store the observer to notify the command completion | |||
| 115 | iObserver = &aObserver; | |||
| 116 | } | |||
| 117 | ||||
| 118 | ||||
| 119 | // -------------------------------------------------------------------------- | |||
| 120 | // CVIMPSTCmdCloseConversation::CommandId | |||
| 121 | // -------------------------------------------------------------------------- | |||
| 122 | // | |||
| 4 | 0 | 123 | TInt CVIMPSTCmdCloseConversation::CommandId() const | |
| 124 | { | |||
| 4 | 125 | return iCommandId; | ||
| 126 | } | |||
| 127 | ||||
| 128 | // -------------------------------------------------------------------------- | |||
| 129 | // CVIMPSTCmdCloseConversation::Result | |||
| 130 | // -------------------------------------------------------------------------- | |||
| 131 | // | |||
| 2 | 0 | 132 | TInt CVIMPSTCmdCloseConversation::Result() const | |
| 133 | { | |||
| 134 | //return valid data regd the command operation | |||
| 2 | 135 | return iError; | ||
| 136 | } | |||
| 137 | ||||
| 138 | // End of File | |||
| ***TER 93% (14/15) of SOURCE FILE cvimpstcmdcloseconversation.cpp | ||||