diff -r 6a20128ce557 -r ebfee66fde93 messagingapp/msgui/appengine/tsrc/testconversationengine/src/testconversationnotifier.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/messagingapp/msgui/appengine/tsrc/testconversationengine/src/testconversationnotifier.cpp Fri Jun 04 10:25:39 2010 +0100 @@ -0,0 +1,161 @@ +/* + * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: + * + */ + +#include "testconversationnotifier.h" + +#include +#include +#include +#include + + +TestConversationNotifier::TestConversationNotifier() + :iResultsObserver(NULL), + iConversationListChangeObserver(NULL), + iConversationChangeObserver(NULL), + iCachingStatusObserver(NULL) +{ +} + +void TestConversationNotifier +::SetResultNotifier(MCsResultsObserver* aResultsObserver) +{ + iResultsObserver = aResultsObserver; +} + +void TestConversationNotifier::RemoveResultNotifier( ) +{ + iResultsObserver = NULL; +} + +void TestConversationNotifier +::SetConversationListNotifier(MCsConversationListChangeObserver* + aConversationListChangeObserver) +{ + iConversationListChangeObserver = aConversationListChangeObserver; +} + +void TestConversationNotifier::RemoveConversationListNotifier( ) +{ + iConversationListChangeObserver = NULL; +} + +void TestConversationNotifier +::SetConversationChangeNotifier(MCsConversationChangeObserver* + aConversationChangeObserver) +{ + iConversationChangeObserver = aConversationChangeObserver; +} + +void TestConversationNotifier::RemoveConversationChangeNotifier() +{ + iConversationChangeObserver = NULL; +} + +void TestConversationNotifier +::SetCachingStatusNotifier(MCsCachingStatusObserver* aCachingStatusObserver) +{ + iCachingStatusObserver = aCachingStatusObserver; +} + +void TestConversationNotifier::RemoveCachingStatusNotifier() +{ + iCachingStatusObserver = NULL; +} + +void TestConversationNotifier +::SendListResultUpdate(RPointerArray& + aConversationEntryList) +{ + // Pass the results to the observer + if ( iResultsObserver ) + { + iResultsObserver->Conversations(aConversationEntryList); + } +} + +void TestConversationNotifier +::UpdateConversationEntryModify(CCsConversationEntry& aConversationEntry) +{ + // Pass the results to the observer + if ( iConversationChangeObserver ) + { + iConversationChangeObserver->ModifyConversation(aConversationEntry); + } +} + +void TestConversationNotifier +::UpdateConversationEntryAdd(CCsConversationEntry& aConversationEntry) +{ + // Pass the results to the observer + if ( iConversationChangeObserver ) + { + iConversationChangeObserver->AddConversation(aConversationEntry); + } +} + +void TestConversationNotifier +::UpdateConversationEntryDelete(CCsConversationEntry& aConversationEntry) +{ + // Pass the results to the observer + if ( iConversationChangeObserver ) + { + iConversationChangeObserver->DeleteConversation(aConversationEntry); + } +} + +void TestConversationNotifier +::SendClientListUpdate(RPointerArray& + aConversationClientList) +{ + // Pass the results to the observer + if ( iResultsObserver ) + { + iResultsObserver->ConversationList(aConversationClientList); + } +} + +void TestConversationNotifier +::UpdateConversationClientModify(CCsClientConversation& aConversationClient) +{ + if ( iConversationListChangeObserver ) + { + iConversationListChangeObserver-> + ModifyConversationList(aConversationClient); + } +} + +void TestConversationNotifier +::UpdateConversationClientAdd(CCsClientConversation& aConversationClient) +{ + if ( iConversationListChangeObserver ) + { + iConversationListChangeObserver-> + AddConversationList(aConversationClient); + } +} + +void TestConversationNotifier +::UpdateConversationClientDelete(CCsClientConversation& aConversationClient) +{ + if ( iConversationListChangeObserver ) + { + iConversationListChangeObserver-> + DeleteConversationList(aConversationClient); + } +} +