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