| Start/ | End/ | |||
| True | False | - | Line | Source |
| 1 | /* | |||
| 2 | * =========================================================================== | |||
| 3 | * Name : cvimpstcmdaddtopbk.cpp | |||
| 4 | * Part of : IMUiServiceTab/vimpstcmdprocess | |||
| 5 | * Description : | |||
| 6 | * Version : %version: 2.1.1 % | |||
| 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 "cvimpstcmdaddtopbk.h" | |||
| 21 | #include "vimpstcmd.hrh" | |||
| 22 | #include "mvimpstcmdobserver.h" | |||
| 23 | #include "vimpstdebugprint.h" | |||
| 24 | ||||
| 25 | #include <e32def.h> | |||
| 26 | #include <mvpbkstorecontact.h> | |||
| 27 | #include "mvimpstengine.h" | |||
| 28 | #include "mvimpststorageserviceview.h" | |||
| 29 | #include "cvimpststoragemanagerfactory.h" | |||
| 30 | ||||
| 31 | // Constants | |||
| 32 | ||||
| 33 | // -------------------------------------------------------------------------- | |||
| 34 | // CVIMPSTCmdAddToPbk::CVIMPSTCmdAddToPbk | |||
| 35 | // -------------------------------------------------------------------------- | |||
| 36 | // | |||
| 4 | 4 | 37 | CVIMPSTCmdAddToPbk::CVIMPSTCmdAddToPbk( const TInt aCommandId , | |
| 38 | const MVIMPSTStorageContact& aStoreContact, | |||
| 39 | MVIMPSTEngine& aEngine) : | |||
| 40 | iCommandId( aCommandId ), | |||
| 41 | iStoreContact( aStoreContact ), | |||
| 42 | iEngine( aEngine ) | |||
| 43 | { | |||
| 44 | } | |||
| 45 | ||||
| 46 | // -------------------------------------------------------------------------- | |||
| 47 | // CVIMPSTCmdAddToPbk::~CVIMPSTCmdAddToPbk | |||
| 48 | // -------------------------------------------------------------------------- | |||
| 49 | // | |||
| 4 | 4 | 50 | CVIMPSTCmdAddToPbk::~CVIMPSTCmdAddToPbk() | |
| 51 | { | |||
| 52 | ||||
| 53 | } | |||
| 54 | ||||
| 55 | // -------------------------------------------------------------------------- | |||
| 56 | // CVIMPSTCmdAddToPbk::NewL | |||
| 57 | // -------------------------------------------------------------------------- | |||
| 58 | // | |||
| 4 | 0 | 59 | CVIMPSTCmdAddToPbk* CVIMPSTCmdAddToPbk::NewL( const TInt aCommandId, | |
| 60 | const MVIMPSTStorageContact& aStoreContact, | |||
| 61 | MVIMPSTEngine& aEngine) | |||
| 62 | { | |||
| 63 | CVIMPSTCmdAddToPbk* self = new (ELeave ) CVIMPSTCmdAddToPbk( aCommandId, aStoreContact, aEngine); | |||
| 64 | self->ConstructL(); //use contsurctL if necessary | |||
| 65 | return self; | |||
| 66 | } | |||
| 67 | // -------------------------------------------------------------------------- | |||
| 68 | // CVIMPSTCmdAddToPbk::ConstructL | |||
| 69 | // -------------------------------------------------------------------------- | |||
| 70 | // | |||
| 4 | 4 | 71 | void CVIMPSTCmdAddToPbk::ConstructL() | |
| 72 | { | |||
| 73 | iError = KErrNone; | |||
| 74 | } | |||
| 75 | ||||
| 76 | // -------------------------------------------------------------------------- | |||
| 77 | // CVIMPSTCmdAddToPbk::ExecuteLD | |||
| 78 | // -------------------------------------------------------------------------- | |||
| 79 | // | |||
| 4 | 4 | 80 | void CVIMPSTCmdAddToPbk::ExecuteLD() | |
| 81 | { | |||
| 82 | CHAT_DP_FUNC_ENTER("CVIMPSTCmdAddToPbk::ExecuteLD"); | |||
| 83 | //push to the cleanupstack | |||
| 84 | CleanupStack::PushL( this ); | |||
| 85 | MVIMPSTStorageServiceView* storage = CVIMPSTStorageManagerFactory::ContactListInterfaceL(iEngine.ServiceId()) ; | |||
| 86 | if(storage) | |||
| 87 | { | |||
| 88 | //storage->AddContactToPhoneBookL(iStoreContact); | |||
| 89 | } | |||
| 90 | else | |||
| 91 | { | |||
| 92 | iError = KErrGeneral; | |||
| 93 | } | |||
| 94 | if(iObserver) | |||
| 95 | { | |||
| 96 | iObserver->CommandFinishedL(*this); | |||
| 97 | } | |||
| 98 | CHAT_DP_FUNC_ENTER("CVIMPSTCmdAddToPbk:: CommandFinished"); | |||
| 99 | CleanupStack::PopAndDestroy(); | |||
| 100 | CHAT_DP_FUNC_DONE("CVIMPSTCmdAddToPbk::ExecuteLD"); | |||
| 101 | } | |||
| 102 | ||||
| 103 | ||||
| 104 | // -------------------------------------------------------------------------- | |||
| 105 | // CVIMPSTCmdAddToPbk::AddObserver | |||
| 106 | // -------------------------------------------------------------------------- | |||
| 107 | // | |||
| 2 | 2 | 108 | void CVIMPSTCmdAddToPbk::AddObserver( MVIMPSTCmdObserver& aObserver ) | |
| 109 | { | |||
| 110 | // store the observer to notify the command completion | |||
| 111 | iObserver = &aObserver; | |||
| 112 | } | |||
| 113 | ||||
| 114 | ||||
| 115 | // -------------------------------------------------------------------------- | |||
| 116 | // CVIMPSTCmdAddToPbk::CommandId | |||
| 117 | // -------------------------------------------------------------------------- | |||
| 118 | // | |||
| 4 | 0 | 119 | TInt CVIMPSTCmdAddToPbk::CommandId() const | |
| 120 | { | |||
| 121 | return iCommandId; | |||
| 122 | } | |||
| 123 | ||||
| 124 | // -------------------------------------------------------------------------- | |||
| 125 | // CVIMPSTCmdAddToPbk::Result | |||
| 126 | // -------------------------------------------------------------------------- | |||
| 127 | // | |||
| 2 | 0 | 128 | TInt CVIMPSTCmdAddToPbk::Result() const | |
| 129 | { | |||
| 130 | //return valid data regd the command operation | |||
| 131 | return iError; | |||
| 132 | } | |||
| 133 | ||||
| 134 | // End of File | |||
| 135 | ||||
| ***TER 100% (8/8) of SOURCE FILE cvimpstcmdaddtopbk.cpp | ||||